javascript - Where do I put the $(document).ready()? -


i've been trying add javascript html/css, been running around in circles.

my current set-up html, css, , javascript files (2 files; javascript code, , jquery's code) separate, linked each other via html page.

so here questions:

1) put link jquery code within html head? or within javascript code page?

2) code go? html page, or javascript page?

$(document).ready(function(){     //code here }); 

3) above, 'code here', mean javascript code, right? not html code?

4) i've read initializing javascript code @ bottom of html page. take though, don't have jquery's .ready function, right?

  1. you should javascript files either in <head> or above closing </body> tag.
  2. the code can go anywhere really, suggest external javascript page.
  3. yes
  4. this correct.

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -