Table of Contents [Hide/Show]
ajax.microsoft.com renamed to ajax.aspnetcdn.com Visual Studio .vsdoc Support Using ASP.NET Ajax from the CDN Using jQuery from the CDN Using jQuery UI from the CDN Third-Party Files on the CDN jQuery Releases on the CDN jQuery Migrate Releases on the CDN jQuery UI Releases on the CDN jQuery Validation Releases on the CDN jQuery Mobile Releases on the CDN jQuery Templates Releases on the CDN jQuery Cycle Releases on the CDN jQuery DataTables Releases on the CDN Modernizr Releases on the CDN Ajax Control Toolkit Releases on the CDN JSHint Releases on the CDN Knockout Releases on the CDN Globalize Releases on the CDN ASP.NET Web Forms and Ajax Releases on the CDN ASP.NET MVC Releases on the CDN ASP.NET SignalR Releases on the CDN
The Microsoft Ajax Content Delivery Network (CDN) hosts popular third party JavaScript libraries such as jQuery and enables you to easily add them to your Web applications. For example, you can start using jQuery which is hosted on this CDN simply by adding a <script> tag to your page that points to ajax.aspnetcdn.com.
By taking advantage of the CDN, you can significantly improve the performance of your Ajax applications. The contents of the CDN are cached on servers located around the world. In addition, the CDN enables browsers to reuse cached third party JavaScript files for web sites that are located in different domains.
The CDN supports SSL (HTTPS) in case you need to serve a web page using the Secure Sockets Layer.
<asp:ScriptManager ID="ScriptManager1" EnableCdn="true" Runat="Server" />
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
<script> // Fallback to loading jQuery from a local path if the CDN is unavailable (window.jQuery || document.write('<script src="/scripts/jquery-1.9.0.min.js"><\/script>')); </script>
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jQuery from Microsoft AJAX CDN</title> </head> <body> <button id="btn">Show Message</button> <div id="message" style="display:none"> <h1>Hello from jQuery!</h1> </div> <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script> <script> // Fallback to loading jQuery from a local path if the CDN is unavailable (window.jQuery || document.write('<script src="/scripts/jquery-1.9.0.min.js"><\/script>')); </script> <script> function domReady() { $('#btn').click( showMessage ); } function showMessage() { $('#message').fadeIn('slow'); } $( domReady ); </script> </body> </html>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestjQueryUICDN.WebForm1" %> <!DOCTYPE html > <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Using jQuery UI from the CDN</title> <link rel="Stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css" /> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="txtStartDate" ClientIDMode="Static" runat="server" /> </div> </form> <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.0.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.22/jquery-ui.js"></script> <script> $("#txtStartDate").datepicker(); </script> </body> </html>