1 <script language=javascript>
2
3 function JSandCSSRegistration()
4 {
5 document.createStyleSheet("style.css");
6 var head = document.getElementsByTagName('HEAD').item(0);
7 var script = document.createElement('SCRIPT');
8 script.src = "common.js";
9 script.type = "text/javascript";
10 head.appendChild(script);
11 }
12
13 JSandCSSRegistration();
14 </script>
2
3 function JSandCSSRegistration()
4 {
5 document.createStyleSheet("style.css");
6 var head = document.getElementsByTagName('HEAD').item(0);
7 var script = document.createElement('SCRIPT');
8 script.src = "common.js";
9 script.type = "text/javascript";
10 head.appendChild(script);
11 }
12
13 JSandCSSRegistration();
14 </script>
为利用控件或者basepage下发js和css设计,当页面太多要下发js或者css时可以偷懒。
只在ie6测试通过,特别是document的createStyleSheet方法不知道别的浏览器是否支持。