日期:2014-05-16 浏览次数:20400 次
//win object var thisWindow = new scriptUtil(); function startUp() { //获取相对路径 var initsrc = thisWindow.getPath(); //加载文件列表js文件。 thisWindow.Import(["staticScript.js"], function(state) { if (state && typeof staticScript != "undefined") { var len = staticScript.length; //加载列表中的文件。 thisWindow.Import(staticScript, function(state) { //处理页面显示事件。 if (typeof thisWindow.onShow == "function") { thisWindow.onShow(); } }, initsrc); } }, initsrc); }; //等待body加载后,执行startUp var sartHandel = setInterval(function() { if(document.getElementsByTagName("body") != null) { clearInterval(sartHandel) startUp(); } else { thisWindow.LogInfo("waitting loading..."); } },20);
staticScript = [ "../css/com.comStyle.css" ];
.winStyle { border:1px solid #C3D2E6; font-size:12px; width:10px; height:10px; }
"import script ../script/common/staticScript.js sucess." "import css ../script/common/../css/com.comStyle.css sucess."
<!DOCTYPE html> <html> <head> <title>test</title> <script type="text/javascript" src="../script/common/init.js"></script> <script type="text/javascript" src="../script/common/staticScript.js"></script> <link rel="stylesheet" type="text/css" href="../script/common/../css/com.comStyle.css"></link> </head> <body> </body> </html>
<!DOCTYPE html> <head><title>test</title> <script src="../script/common/init.js" type="text/javascript"></script> </head> <body> </body> </html>