ie8

Manage jQuery in IE8 with bower

Here’s a quick way of using up to date jQuery whilst still supporting IE8.

In ASP.NET MVC Razor

    <!--[if IE 8 ]>
    @Scripts.Render("~/bower_components/jquery-legacy/dist/jquery.min.js")
    <![endif]-->
    <!--[if (gt IE 9)|!(IE)]>
    @Scripts.Render("~/bower_components/jquery-modern/dist/jquery.min.js")
    <![endif]-->

In your bower.json

    "dependencies": {
      "bootstrap": "~3.3.5",
      ...,
      "jquery-legacy": "jquery#^1",
      "jquery-modern": "jquery#^2"
    }