MVC - Selectively Loading jQuery Debug or Release Scripts
Download Project Source P age load times are critical to a satisfying user experience. One of the simplest ways to reduce load times is to Minify your jQuery and Javascript files. I won't go into detail on how to Minify those files in this post (hint: http://yui.2clics.net/ ). Instead, this article deals with the headaches of debugging Minified files. For example, here's a typical Javascript error: However, its impossible to debug this issue because I'm referencing the Minified version of jquery-1.5.1. I'd have an easier time defusing a small nuclear device. On the other hand, I don't want to go referencing debug versions of Javascript files throughout my code only to have to do a search and replace every time I want to release. The solution is in MVC's Html Helper classes. The @ Html and @ HtmlHelper methods are provided to render html controls on the view in a code-centric way. However, their functionality isn't ...