close

參考 : http://www.3dwoo.com/showBookDetail.asp?nb=47443

已前一般都是放到 head  

 <html>
 <head>
 <script type="text/JavaScript">
 <!-- 
 document.write("Hello world !! ") 
 //-->
 </script>
 </head>
</html>

後來放 body

 <html>
 <body>
 <script type="text/JavaScript">
 <!-- 
 document.write("Hello world !! ") 
 //-->
 </script>
 </body>
</html>

放 head 是一定會下載 , 且會讀完js才會顯示頁面,而且 js是逐個下載

放到 body 之後

 <html>
 <body>

 </body>
 <script type="text/JavaScript">
 <!-- 
 document.write("Hello world !! ") 
 //-->
 </script>
</html>

其實與放到 body 內是一樣的  ..... 瀏覽器會忽略 </body> 的結束 

這樣的好處是好看 .....XD

 

arrow
arrow
    全站熱搜

    echochio 發表在 痞客邦 留言(0) 人氣()