Jump to content

Javascript in head or not


virtual

Recommended Posts

Thanks Eric.

 

I have a lot of JS on an index page for a drop down menu and a big slider with text and images.

 

So if the page loads quicker with the JS at the bottom what happens to the functionality of say the menu if someone clicks on it before the JS has loaded?

 

Also, why do you say "If you can"?

Edited by virtual
Link to comment
Share on other sites

Hello, thats why I say if you can. So for your menu you can't (or proabably shouldn't). For menus and things that may need to work immediatly, then in the head is probably nessesary. But for things like form enhancment (non critical stuff) then place those at the bottom. I'm anal, so usually if I can't put them all at the bottom (keep them together) then I don't put any at the bottom. If you google speed up web page download, that suggestion should be top on the list.

Link to comment
Share on other sites

OK thanks, I won't bother because the page load speed is perfectly acceptable. The site is fairly image heavy (essential to the site and all optimized for web) so I think it is that which is slowing it down slightly, rather than all the JS files.

Edited by virtual
Link to comment
Share on other sites

virtual, try the site at this link: http://www.websiteoptimization.com/services/analyze/

 

You could try it both ways and see if it makes a difference.

 

There is also a Yahoo! service which will assist by measuring the parts of the page that are slowing you down, but I'll need a bit of search time in order to provide a link. I seem to have lost it. I go search right now.

 

http://developer.yahoo.com/yslow/

Edited by jlhaslip
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...