在IE环境下,jsp中动态引入的js文件加载顺序和其他浏览器并不一致,在jsp调用js中方法时存在不能调用的情况,
这时候可以用单个js文件加载完成回调函数中调用该js的方法。
-
var script = document.createElement("script");
-
script.setAttribute("type","text/javascript");
-
script.onreadystatechange = function() {
-
if(this.readyState == "loaded" || this.readyState == "complete"){
-
alert("加载成功啦!");
-
openYeMian('公共文件夹');
-
-
}
-
}
-
script.setAttribute("src","<%=appPath%>/menu/navigator/outlook/childMenu.js");
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25130668/viewspace-1778848/
,如需转载,请注明出处,否则将追究法律责任。