Error in RazorScriptManager - 0.6.1 of Nuget Gallery

I am using RazorScriptManager - 0.6.1 to minify my js and css files for my asp.net mvc 3 application.

When i use AddJavaScript method as:

@Script.AddJavaScript(localPath: "~/Scripts/jquery-1.6.min.js", siteWide: true)
@Script.AddJavaScript(localPath: "~/Scripts/modernizr-1.7.min.js", siteWide: true)
@Script.AddJavaScript(localPath: "~/Scripts/jquery.validate.min.js", siteWide: true)
@Script.AddJavaScript(localPath: "~/Scripts/jquery.unobtrusive-ajax.min.js", siteWide: true)
@Script.AddJavaScript(localPath: "~/Scripts/jquery.validate.unobtrusive.min.js", siteWide: true)
@Script.OutputJavaScript()

It shows js error for any script reference that comes after jquery-1.6.min.js reference. Below is the screenshot of the error:

Please advice on this..

Answers


It appears this might be a JavaScript-related issue, not a problem with the script manager.

The error itself appears to be in jquery.validate.min.js, which is being loaded after the reference to modernizr-1.7.min.js. I created an empty sample project referencing the same JavaScript files as you did (except with 1.6.1 instead of 1.6), and I did run into a conflict between script versions. I updated my sample project to use the latest versions, and I have no errors:

@Script.AddJavaScript(localPath: "~/Scripts/jquery-1.6.1.min.js", siteWide: true)
@Script.AddJavaScript(localPath: "~/Scripts/modernizr-2.0.6-development-only.js", siteWide: true)
@Script.AddJavaScript(localPath: "~/Scripts/jquery.validate.min.js", siteWide: true) //v1.8.1
@Script.AddJavaScript(localPath: "~/Scripts/jquery.unobtrusive-ajax.min.js", siteWide: true)
@Script.AddJavaScript(localPath: "~/Scripts/jquery.validate.unobtrusive.min.js", siteWide: true)

Try updating all the JavaScript NuGet packages in your project and see if that solves your problem. If it doesn't, open an issue in the project on GitHub and I'll take a look at it.


Need Your Help

Makefile for compiling c++ program

c++ linux makefile

I'm using g++ on linux and writing multiple cpp programs. For ex. I have ex1.cpp, ex2.cpp, bot.cpp.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.