JQuery plugin crashes when it is connected to MVC

I have an MVC 4 application that uses jquery, jquery ui, jquery validation and this datetimepicker plugin. They are added using the binding tools in MVC.

Everything works fine, just starting it up with F5. However, when I deploy it to the server, there is a script error in the plugin (the object does not support this action). If I debug it locally and install it in the web.config file, then it fails with the same error.

One of the differences is that when run in debug, it does not merge. Could this be a problem? What happens, can this cause this error?

+4
source share
4 answers

I came across the same problem, and then this problem decided to rename the .min.js file to .js (removing .min )

+4
source

I ran into the same problem and managed to isolate the code that causes the release error.

I sent a removal request to the author with the fix .

+1
source

Automatic minimization when using packages causes a problem.

If I reference JQuery directly in the _layout.cshtml file:

 @Scripts.Render("~/Scripts/jquery-1.8.2.min.js") 

The problem disappears.

0
source

The solution even thought it was an old question

To prevent this from happening, just make sure all your js functions end:

 function someName(){ }; <- the important part! 

Or you can delete all comments in the .js file.

0
source

Source: https://habr.com/ru/post/1439025/


All Articles