JS文件提速方法: ; [ Y$ p% w0 D5 a$ b
把通常加载方式:<script src="dancead.js"></script>
$ z/ C& I2 [( L* m改变成:<script type="text/javascript"> document.write("<scr"+"ipt src=\"dancead.js\"></sc"+"ript>") ; </script> % @! u1 g- f' U; f& H' ]) M
. x+ `9 y# L+ S4 V2 WJS文件延迟加载方法: 0 W8 @* g, u6 `- U# N' z J) V2 w
JS延迟加载代码如下:<script language="JavaScript" src="" id="ToTwo"></script> $ t1 j5 m4 ~5 H; B w
<script> setTimeout("document.getElementById('ToTwo').src='http://www.xp37.com/include.js'; ",3000);//延时3秒 </script> |