General HTML page layout
good morning,
two simple questions on how layout "general" page (html or php)
1. in terms of "script" links @ top of page this;
<script src="scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
do put all of links use @ top of every page, though might not use them on page?
(so don't have worry "did put link there?")
2. put javascript scripts?
i've seen them put everywhere head, top of body bottom of body.
i read somewhere "all javascripts should placed above </body> line".
is there concensus on these 2 issues?
thanks in advance.
the <script> element can placed anywhere within <head> , <body>. javascript executed after it's loaded (unless defer and/or asyncattributes set external scripts), that's why may want place after html elements want script work - when script run there elements present.
as linking jquery library, don't need include on page not have script utilising jquery, no harm done if do. (do not link 2 different versions in same page though.)
--
kenneth kawamoto
[link removed moderator]
More discussions in Dreamweaver support forum
adobe
Comments
Post a Comment