页面加载后加载respond.js

时间:2022-10-12 21:49:52

Is there a way to load respond.js after the page is fully loaded and does it need a call to activate it after?

有没有办法在页面完全加载后加载respond.js,是否需要调用后激活它?

My problem is that I can't edit the structure of the web app, I can just manipulate the "skin files" (those include a css and js file).

我的问题是我无法编辑Web应用程序的结构,我只能操作“皮肤文件”(包括css和js文件)。

I can include it in the js file, however the situation is that the js file is loaded before the skin css file, and as I read about the respond.js it needs to be loaded after the style sheet to work.

我可以将它包含在js文件中,但是情况是在skin css文件之前加载了js文件,当我读到有关response.js时,需要在样式表工作之后加载它。

This is needed for a responsive design to work in IE8.

这是响应式设计在IE8中工作所必需的。

Any help or suggestions would be great.

任何帮助或建议都会很棒。

The structure is like this:

结构是这样的:

<head>
/*bunch of jquery scripts*/
/*skin js file with the respond.js file linked*/
/*skin css file*/
</head>
<body>
</body>

1 个解决方案

#1


0  

if you are using jquery than you can do this.

如果你使用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);
});

hope this will help you.

希望这会帮助你。

#1


0  

if you are using jquery than you can do this.

如果你使用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);
});

hope this will help you.

希望这会帮助你。