Skip to content

Instantly share code, notes, and snippets.

@ntotten
Created July 7, 2013 21:14
Show Gist options
  • Save ntotten/5945001 to your computer and use it in GitHub Desktop.
Save ntotten/5945001 to your computer and use it in GitHub Desktop.
bundles.UseCdn = true;
BundleTable.EnableOptimizations = true;
var jquery = new ScriptBundle("~/bundles/jquery", "//ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.1.min.js")
.Include("~/Scripts/jquery-{version}.js");
jquery.CdnFallbackExpression = "window.jQuery";
bundles.Add(jquery);
<script src="//ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.1.min.js"></script>
<script>(window.jQuery)||document.write('<script src="/bundles/jquery"><\/script>');</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment