是否有一种方法可以在页面完全加载后加载respond.js,然后是否需要调用才能激活它?
我的问题是,我不能编辑web应用程序的结构,我只需操作“皮肤文件”(包括css和js文件)。
我可以将它包含在js文件中,但是情况是js文件是在皮肤css文件之前加载的,而且当我读到关于respond.js的文章时,它需要在样式表之后加载才能工作。
对于在IE8中工作的响应设计来说,这是必需的。
任何帮助或建议都会很好。
结构是这样的:
<head>
/*bunch of jquery scripts*/
/*skin js file with the respond.js file linked*/
/*skin css file*/
</head>
<body>
</body>发布于 2014-08-12 11:31:53
如果您正在使用jquery,那么您可以这样做。
$(window).bind("load", function() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'path to ur js file';
document.head.appendChild(script);
});希望这能帮到你。
https://stackoverflow.com/questions/25262258
复制相似问题