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?
- you should javascript files either in
<head>
or above closing</body>
tag. - the code can go anywhere really, suggest external javascript page.
- yes
- this correct.
Comments
Post a Comment