Friday, 27 September 2013

Jquery UI accordion working in MVC 4 debug mode but not in the release

Jquery UI accordion working in MVC 4 debug mode but not in the release

I work on an ASP.NET MVC 4 application.
I updated jQuery, jQuery UI and all other nuget packages in my project.
Built it and ran it to see that no problems occured. Everything worked so
I continiued development for several days.
After a while I published the project to a test-server I have to see how
it looked on Ipad, Iphone etc. And then I realized that the jQuery-UI
accordion stopped working.
It renders, but does not respond on click. This goes for all browsers. I
found this strange since the only difference is that the MVC bundeling i
applied in release mode and as far as I understand it either minifies the
jQuery file or chooses the minified version (the latter probably beeing
what is does here since it is added when updating using nuget).
The jQuery version is: 2.0.3
The jQuery-ui version is: 1.10.3
In Chrome console the error reads:
Uncaught TypeError: Cannot read property 'safari' of undefined
OK, so i realize this might be the result of one of my jQuery assemblies
references $.browser that apparently was removed in jQuery 1.9.
However the fact that it works in debug mode (using the non-minified
versions) leads me to think that it might not be that. I could almost
think that it is a problem with the minified versions, but that should not
be possible either.
Anyone knows why this happens and know how to fix it?

No comments:

Post a Comment