The default ASP.MVC 3 + Tools Update application created includes jQuery 1.5.1 by default. To update it to a newer version, the easiest method is to use the Package Manager Console. However, packages dependent upon jQuery must be updated first.
PM> install-package jquery.vsdoc
PM> install-package jquery.ui.combined
PM> install-package jquery.validation
Now we're ready to update jQuery...
PM> install-package jquery
Your project is now up to date, but you already generated Views, you must update the script tags manually:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<script src="@Url.Content("~/Scripts/jquery-1.6.1.min.js")" type="text/javascript"></script>
...
Note: jQuery 1.6 introduced breaking changes to .attr(), moving some functionality over to .prop(). In jQuery 1.6.1, these breaking changes were "fixed", by mapping some of the old .attr functionality over to .prop() automatically. Nevertheless, if you have relied on .attr(), please test your code after this update. The jQuery Blog announcing 1.6.1 has more details.
Additionally, the API for jQuery-UI is undergoing changes as well. If you use that package, review the changelog and the documentation to see the current status.
No comments:
Post a Comment