0
votes

i recently joined in a new company and found out they were using so many scripts in Layout.cshtml.as shown in fig enter image description here

so in order to improve the performance,i used mvc bundling functions as shownenter image description here

and referenced it on layout page with @Scripts.Render("~/bundles/jqueryval").but the problem is.many of the java scripts doesnt work any more especially jquery data table.what point im missing here?

2
I had a similar issue. Check the ends of the files and ensure they have ; in place, and possibly some line breaks. The bundler concatenates the text of all the files together, so if the previous file is not ended correctly you can run in to problems. - Rory McCrossan
Please include the code as text, formatted in a code block, instead of screenshots. - user247702
EnableOptimizations=true causes every script to be minified. You are telling to include the minified scripts, which get re-minified. In our case this caused problems because somehow the minified version of a library didnt correspont to the non-minified. Re-minifying the script did the trick. - devqon

2 Answers

0
votes

I think in your scenario your js files are conflicting with each other ,solution for your problem is :

Use $.noConflict() to avoid conflicts between jquery's files :-

Follow this link :

http://api.jquery.com/jquery.noconflict/

if some js files are not working then just check the order of your js files also..

0
votes

Try and check if the files are in the correct order. If you are on local, you might have some setting to not load the .min file, happened to me once. 2 suggestions, add scripts after css and maybe start using requirejs, it will help you with the dependencies and async loading of the js