Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Bidding Directory   1,000 Directory Submissions   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 08-08-2006, 02:57 PM   #1 (permalink)
Inactive
 
JoeWall's Avatar
 
Join Date: 04-11-06
Posts: 28
iTrader: 0 / 0%
Latest Blog:
None

JoeWall is on the right pathJoeWall is on the right pathJoeWall is on the right path
script to load images and js after the page loads ??

hello

i run http://sprinj.com and the biggest problem right now is that pages weigh in average 300kb which is way too much for me.

so i was wondering if there is any script out there who will load ressources like jpegs, png, javascripts, css like a few seconds after the html page is loaded, so that the user can see the page is coming and he can read something meanwhile all other ressources are loaded in the background

JoeWall is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 08-08-2006, 10:13 PM   #2 (permalink)
Inactive
 
ali_420's Avatar
 
Join Date: 06-16-06
Posts: 268
iTrader: 0 / 0%
Latest Blog:
None

ali_420 is on the right pathali_420 is on the right pathali_420 is on the right path
This can be done through some javascript. However, an easier way is to put all your javascript in an external file, and use CSS for the styling (and keep that in an external file too).
ali_420 is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-10-2006, 07:34 AM   #3 (permalink)
Inactive
 
Mrblogs's Avatar
 
Join Date: 03-29-06
Posts: 548
iTrader: 0 / 0%
Mrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really nice
Send a message via MSN to Mrblogs Send a message via Yahoo to Mrblogs
Can I ask why it is about 300kb?
Mrblogs is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-10-2006, 02:44 PM   #4 (permalink)
Inactive
 
JoeWall's Avatar
 
Join Date: 04-11-06
Posts: 28
iTrader: 0 / 0%
Latest Blog:
None

JoeWall is on the right pathJoeWall is on the right pathJoeWall is on the right path
Quote:
Originally Posted by Mrblogs
Can I ask why it is about 300kb?
well the html pages are very light, but the javascripts weighs quite a lot (about 200kb it depends on the page) and then there are the images used for the layout.

I have just used a javascript compressor and saved 50 kb but still i would like to find something that can load ressources in the background , if thast exists
JoeWall is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-10-2006, 06:01 PM   #5 (permalink)
Inactive
 
ali_420's Avatar
 
Join Date: 06-16-06
Posts: 268
iTrader: 0 / 0%
Latest Blog:
None

ali_420 is on the right pathali_420 is on the right pathali_420 is on the right path
Joewall,
dude, you really need to put all your javascript in another file and remove it from the HTML. Then, where it says the javascript right now, put this line:
PHP Code:
<script type="text/javascript" src="/path-to-file/javascript.js">
</script> 
This would get you rid of all the javascript showing up in the HTML code as you would put it all in the file "javascript.js".
ali_420 is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-11-2006, 03:34 AM   #6 (permalink)
Inactive
 
Mrblogs's Avatar
 
Join Date: 03-29-06
Posts: 548
iTrader: 0 / 0%
Mrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really nice
Send a message via MSN to Mrblogs Send a message via Yahoo to Mrblogs
There is some serious coding going on to require 200kb of Javascript.. o_O
Mrblogs is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-11-2006, 12:07 PM   #7 (permalink)
Inactive
 
JoeWall's Avatar
 
Join Date: 04-11-06
Posts: 28
iTrader: 0 / 0%
Latest Blog:
None

JoeWall is on the right pathJoeWall is on the right pathJoeWall is on the right path
Quote:
you really need to put all your javascript in another file and remove it from the HTML.
actually there are no javascripts in my html code, they are all in external files.
Quote:
There is some serious coding going on to require 200kb of Javascript.. o_O
the truth is i do really need those 200kb javascripts. (ajax functions, a calendar, text editing...)
JoeWall is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-12-2006, 12:01 PM   #8 (permalink)
Inactive
 
BinkyMelnik's Avatar
 
Join Date: 06-06-06
Location: New York, NY
Posts: 586
iTrader: 0 / 0%
Latest Blog:
None

BinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to behold
JoeWall:

Quote:
the truth is i do really need those 200kb javascripts. (ajax functions, a calendar, text editing...)
Given the URL you posted, I can't see that any of those things takes place on that page. Howzabout just loading each as needed? Given that the majority of the world is still on dialup (sigh), and that most folks haven't got a lotta RAM or a whole lotta processing power, they'll be hard-pressed to load your pages if you're bogging 'em down with all kindsa features they won't be making use of at any given moment.
BinkyMelnik is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-15-2006, 08:29 AM   #9 (permalink)
Inactive
 
Mrblogs's Avatar
 
Join Date: 03-29-06
Posts: 548
iTrader: 0 / 0%
Mrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really nice
Send a message via MSN to Mrblogs Send a message via Yahoo to Mrblogs
Javascript should be loaded as needed, same with CSSs.

HTML is flexible enough to do so.

It would then also be easier to create a script to load images.
Mrblogs is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2006, 01:16 AM   #10 (permalink)
Inactive
 
ali_420's Avatar
 
Join Date: 06-16-06
Posts: 268
iTrader: 0 / 0%
Latest Blog:
None

ali_420 is on the right pathali_420 is on the right pathali_420 is on the right path
Quote:
Originally Posted by JoeWall
actually there are no javascripts in my html code, they are all in external files.
Oh, I thought the actual output of each page is 200KB because you put all the javasvript in the same place. That would give you serious issues with the search engines too.
ali_420 is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2006, 02:05 PM   #11 (permalink)
Inactive
 
JoeWall's Avatar
 
Join Date: 04-11-06
Posts: 28
iTrader: 0 / 0%
Latest Blog:
None

JoeWall is on the right pathJoeWall is on the right pathJoeWall is on the right path
Quote:
Originally Posted by Mrblogs
Javascript should be loaded as needed, same with CSSs.

HTML is flexible enough to do so.

It would then also be easier to create a script to load images.
but is there a name for this kind of script. i have searched on google but nothing that looks like what i want. for example a script that loads heavy ressources like 10 seconds the page is loaded.
JoeWall is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-17-2006, 02:24 PM   #12 (permalink)
Inactive
 
BinkyMelnik's Avatar
 
Join Date: 06-06-06
Location: New York, NY
Posts: 586
iTrader: 0 / 0%
Latest Blog:
None

BinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to beholdBinkyMelnik is a splendid one to behold
JoeWall:

Does this help you at all? http://www.cryer.co.uk/resources/javascript/script3.htm
BinkyMelnik is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-18-2006, 07:15 AM   #13 (permalink)
Inactive
 
Mrblogs's Avatar
 
Join Date: 03-29-06
Posts: 548
iTrader: 0 / 0%
Mrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really nice
Send a message via MSN to Mrblogs Send a message via Yahoo to Mrblogs
It is just a matter of using the appropriate display attributes for the style element of divs.

Put a DIV around the contents of the site, and initially set it to "display: none;"

then create another div, with some "loading please wait" text in and set that to display: block;

then on the OnLoad of the page, run your javascript script that loads all the images in one by one, then change the displays of the divs around.
Mrblogs is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-18-2006, 10:45 AM   #14 (permalink)
Inactive
 
JoeWall's Avatar
 
Join Date: 04-11-06
Posts: 28
iTrader: 0 / 0%
Latest Blog:
None

JoeWall is on the right pathJoeWall is on the right pathJoeWall is on the right path
Quote:
Originally Posted by Mrblogs
Put a DIV around the contents of the site, and initially set it to "display: none;"

then create another div, with some "loading please wait" text in and set that to display: block;

then on the OnLoad of the page, run your javascript script that loads all the images in one by one, then change the displays of the divs around.
that surely looks for the tip i was looking for, will be testing it right away. thanks!
thanks i have seen it looks good too.
JoeWall is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Action script 3 load swf Alexandro Coding Forum 0 01-18-2008 03:41 AM
What are Page Loads when discussing webstats? chrisnrach17 SEO Forum 4 05-31-2007 01:08 PM
Refresh page once on load flox74 Web Design Lobby 4 04-24-2006 10:38 AM
Usability & Page Load Times John Scott Web Usability 19 12-10-2005 03:51 PM
Images load Faster Stitchy626 Web Design Lobby 6 04-22-2005 01:09 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 06:55 PM.
© Copyright 2008 V7 Inc