amateurhour — 2012-06-17T14:43:18-04:00 — #1
<title>This is my Sample Page</title>
<link rel="stylesheet" type="text/css" href="main1.css" />
felgall — 2012-06-17T17:35:41-04:00 — #2
amateurhour — 2012-06-18T00:04:51-04:00 — #3
thanks for the response. Two quick follow-up questions: (1) so should I remove the $(document).ready entirely? and (2) should I also put the link to jQuery down near the bottom before the closing body tag as well - e.g., <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> Thanks!
ralphm — 2012-06-18T00:11:16-04:00 — #4
It isn't needed, but I don't think it does any harm, either. 'Sup to you.
should I also put the link to jQuery down near the bottom before the closing body tag as well
amateurhour — 2012-06-18T11:35:48-04:00 — #5
felgall — 2012-06-18T18:03:45-04:00 — #6
Having it there would slow the script running in those browsers that can't detect when the HTML has loaded and which therefore have to wait for the load event to be triggered instead. So if there are lots of images in the page and you have a significant number of visitors using old browsers then getting rid of it might speed things up a bit.
ralphm — 2012-06-18T19:42:02-04:00 — #7
Yes, I've also seen problems with jQuery not working, which seemed to be caused by linking to jQuery in the head and having scripts at the bottom of the page. Moving the library to the bottom of the page fixed the problem, so I can only assume that was the problem.