简体   繁体   English

如何在完全加载之前从一页中删除js文件

[英]How to remove a js file from one page before it load completely

I am facing a problem with my javascript include . 我的javascript include遇到问题。 The app is already developed using some old version of jquery. 该应用程序已经使用某些旧版本的jquery开发。 Now I am using some new version of jquery files that is making some problem . 现在我正在使用一些新版本的jquery文件,这会引起一些问题。 The error when I am including new file is this. 当我包括新文件时的错误是这样的。

Uncaught TypeError: Object [object Object] has no method 'datepicker' 

I tried the noCOnflict solution . 我尝试了noCOnflict解决方案。 But it didn't work for me . 但这对我没用。

Found that if I remove the new .js file then rest of my php files are working perfectly. 发现如果我删除了新的.js文件,则其余的php文件都可以正常工作。 But new page is throwing some error.Both are depend . 但是新页面抛出了一些错误。

So I thought of removing the js file based on url which I am rendering . 所以我想根据我渲染的URL删除js文件。 Is it possible ? 可能吗 ? Because I tried but it is not removing. 因为我尝试过,但并没有消除。

Thanks in advance 提前致谢

datepicker is not part of jQuery, but part of jQuery UI. datepicker不是jQuery的一部分,而是jQuery UI的一部分。 I bet if you include jQuery UI, that error and other errors will go away. 我敢打赌,如果您包括jQuery UI,该错误和其他错误将会消失。

http://jqueryui.com/ http://jqueryui.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM