admin管理员组文章数量:1306161
I have created a simple page that use jQuery, so include jquery.min.js.
But I have to insert an iFrame in the same page (and no, unfortunately I can't use anything else) that include a different versione of jquery.min.js.
How can I force the browser to include only one of those two version (like an include_once in php)?
Thank you!
I have created a simple page that use jQuery, so include jquery.min.js.
But I have to insert an iFrame in the same page (and no, unfortunately I can't use anything else) that include a different versione of jquery.min.js.
How can I force the browser to include only one of those two version (like an include_once in php)?
Thank you!
Share Improve this question asked Oct 25, 2011 at 10:13 Marco PaceMarco Pace 3,87021 silver badges38 bronze badges1 Answer
Reset to default 10Not tested but at the end of your page, just before </body>
tag, you can add this:
<script>
window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>
This checks if jQuery is available or not, if not it will add one dynamically from path specified.
本文标签: javascriptSimulate an quotincludeoncequot for jQueryStack Overflow
版权声明:本文标题:javascript - Simulate an "include_once" for jQuery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741818706a2399232.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论