Home / AJAX

Page History: Microsoft Ajax Content Delivery Network

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2010/04/23 22:33


The Microsoft Ajax Content Delivery Network (CDN) enables you to easily add popular JavaScript libraries such as jQuery to your Web applications. For example, you can start using jQuery simply by adding a <script> tag to your page that points to Ajax.microsoft.com.



By taking advantage of the Microsoft Ajax CDN, you can significantly improve the performance of your Ajax applications. The contents of the Microsoft Ajax CDN are cached on servers located around the world. In addition, the Microsoft Ajax CDN enables browsers to reuse cached JavaScript files for Web sites that are located in different domains.



The Microsoft Ajax Content Delivery Network supports SSL (HTTPS) in case you need to serve a web page using the Secure Sockets Layer.



The Microsoft Ajax CDN includes the following libraries:

  • jQuery
  • jQuery Validation
  • Ajax Control Toolkit
  • ASP.NET Ajax
  • ASP.NET MVC JavaScript Files

Using ASP.NET Ajax from the CDN

When using ASP.NET 4, you can redirect all requests for ASP.NET framework scripts to the CDN. Retrieving scripts from the CDN instead of your local web server can substantially improve the performance of public ASP.NET websites.

Use the ScriptManager EnableCDN property to redirect all ASP.NET framework script requests to the Microsoft Ajax CDN:

<asp:ScriptManager
  ID="ScriptManager1"
  EnableCdn="true"
  Runat="Server" />




Using jQuery from the CDN

You can download jQuery scripts from the CDN and use them in your Web application by adding the following script element to a page:

    <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js" type="text/javascript"></script>                        

The CDN also includes the minified version of the jQuery script, which you can get using the following element:



    <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>

The following sample page uses the CDN version of the jQuery library to display the contents of a div element when a button is clicked.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>jQuery from Microsoft AJAX CDN</title>
        <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js" type="text/javascript"></script>
 
        <script type="text/javascript">
        
        $( domReady );
        
        function domReady() {
            $('#btn').click( showMessage );
        }
        
        function showMessage() {
            $('#message').fadeIn('slow');
        }
        
        </script>
    </head>
    <body>
 
    <button id="btn">Show Message</button>
 
    <div id="message" style="display:none">
 
        <h1>Hello from jQuery!</h1>
 
    </div>
 
    </body>
    </html>
 
You can learn more about jQuery and download a local copy of jQuery by visiting the jQuery Web site.





jQuery Releases on the CDN

The following releases of jQuery are hosted on the CDN:

jQuery version 1.4.2

  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js
  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js

jQuery version 1.4.1

  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.1.js
  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.1.min.js
  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.1-vsdoc.js

jQuery version 1.4

  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.js
  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.min.js

jQuery version 1.3.2

  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.js
  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.min.js
  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2-vsdoc.js
  • http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.min-vsdoc.js

jQuery Validation Releases on the CDN

The following releases of the jQuery Validation library are hosted on this CDN. Click each link to see the actual list of files.


Ajax Control Toolkit Releases on the CDN

The following releases of the client portion of the Ajax Control Toolkit are hosted on this CDN. Click the link to see the actual list of files.


ASP.NET Ajax Releases on the CDN

The following releases of the ASP.NET Ajax Library are hosted on the CDN. Click each link to see the actual list of files.


ASP.NET MVC Releases on the CDN

The following ASP.NET MVC JavaScript files are hosted on this CDN:

ASP.NET MVC 1.0

  • http://ajax.microsoft.com/ajax/mvc/1.0/MicrosoftMvcAjax.js
  • http://ajax.microsoft.com/ajax/mvc/1.0/MicrosoftMvcAjax.debug.js

For information about the terms of use for the CDN, see Microsoft Ajax CDN Terms of Use.