Microsoft Ajax Content Delivery Network

Microsoft Ajax Content Delivery Network

出处:http://www.asp.net/ajaxlibrary/CDN.ashx

 

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.



The CDN hosts the following third party script libraries which have been uploaded, and are licensed to you, by the owners of those libraries:

  • jQuery (www.jquery.com)
  • jQuery UI (www.jqueryui.com)
  • jQuery Mobile (www.jquerymobile.com)
  • jQuery Validation (www.jquery.com)
  • jQuery Cycle (www.malsup.com/jquery/cycle/)
  • jQuery DataTables (http://datatables.net/)
  • Ajax Control Toolkit (owned by the Outercurve Foundation – www.outercurve.org)

The Microsoft Ajax CDN also includes the following libraries which have been uploaded by Microsoft:

  • ASP.NET Ajax
  • ASP.NET MVC JavaScript Files 

Microsoft does not claim ownership of any third-party libraries hosted on this CDN. The copyright owners of the libraries are licensing these libraries to you. Any rights that you may have to download and use such libraries are granted solely by the respective copyright owners. Because these are not Microsoft libraries, Microsoft provides no warranties or intellectual property rights licenses (including no implied patent rights) for the third party libraries hosted on this CDN.

If you wish to submit your JavaScript library and your library is one of the top 5 JavaScript libraries (as listed on http://trends.builtwith.com) or extensions/plugins to these libraries that are (a) popular; or (b) helpful for use on ASP.NET then please contact [email protected].

ajax.microsoft.com renamed to ajax.aspnetcdn.com

The CDN used to use the microsoft.com domain name and has been changed to use the aspnetcdn.com domain name. This change was made to increase performance because when a browser referenced the microsoft.com domain it would send any cookies from that domain across the wire with each request. By renaming to a domain name other than microsoft.com performance can be increased by as much to 25%. Note ajax.microsoft.com will continue to function but ajax.aspnetcdn.com is recommended.

  • Old Format: http://ajax.microsoft.com/ajax/jQuery/jquery-1.6.2.js
  • New Format: http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.js

Visual Studio .vsdoc Support

To use the .vsdoc files properly with Visual Studio 2008 you need to make sure that you have VS 2008 SP1 installed and the hotfix for vsdoc files installed. You can get these from here:

Download Visual Studio 2008 SP1

Download .vsdoc hotfix for Visual Studio 2008 SP1

Visual Studio 2010 supports .vsdoc files without any additional patches.

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:

  1. <asp:ScriptManager  
  2.   ID="ScriptManager1"  
  3.   EnableCdn="true"  
  4.   Runat="Server" />  

Using jQuery from the CDN

You can use jQuery scripts hosted on CDN in your Web application by adding the following script element to a page:  

    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.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.aspnetcdn.com/ajax/jquery/jquery-1.5.1.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.

  1. <!DOCTYPE html>  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head>  
  4.     <title>jQuery from Microsoft AJAX CDN</title>  
  5.     <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.js"></script>  
  6.   
  7.     <script>  
  8.       
  9.     $( domReady );  
  10.       
  11.     function domReady() {  
  12.         $('#btn').click( showMessage );  
  13.     }  
  14.       
  15.     function showMessage() {  
  16.         $('#message').fadeIn('slow');  
  17.     }  
  18.       
  19.     </script>  
  20. </head>  
  21. <body>  
  22.   
  23. <button id="btn">Show Message</button>  
  24.   
  25. <div id="message" style="display:none">  
  26.   
  27.     <h1>Hello from jQuery!</h1>  
  28.   
  29. </div>  
  30.   
  31. </body>  
  32. </html>  
You can learn more about jQuery and download a local copy of jQuery by visiting the   jQuery  Web site.  

Using jQuery UI from the CDN

The CDN also hosts the jQuery UI library. The jQuery UI library includes a rich set of widgets and effects that you can use in your ASP.NET applications. For example, the following page illustrates how you can use the jQuery UI Datepicker in the context of an ASP.NET Web Forms application to display a pop-up calendar:

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestjQueryUICDN.WebForm1" %>  
  2. <!DOCTYPE html >  
  3. <html xmlns="http://www.w3.org/1999/xhtml">  
  4. <head runat="server">  
  5.     <title>Using jQuery UI from the CDN</title>  
  6.     <link rel="Stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css" />  
  7. </head>  
  8. <body>  
  9.     <form id="form1" runat="server">  
  10.     <div>  
  11.       
  12.         <asp:TextBox ID="txtStartDate" ClientIDMode="Static" runat="server" />  
  13.   
  14.     </div>  
  15.     </form>  
  16.   
  17.     <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.js"></script>  
  18.     <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.js"></script>  
  19.   
  20.     <script>  
  21.   
  22.         $("#txtStartDate").datepicker();  
  23.   
  24.     </script>  
  25. </body>  
  26. </html>  

When you move focus to the TextBox using your keyboard, a calendar is displayed:



Notice that you must include three files from the CDN in the code above:

  • The jQuery library — The jQuery UI library depends on the jQuery library. You must add the jQuery library to your page before you add the jQuery UI library.

  • The jQuery UI library — The jQuery UI library contains all of the jQuery UI effects and widgets such as the Datepicker widget used in the page above. 

  • A jQuery UI theme — The jQuery UI supports different themes. The page above includes a link to a CSS file to import the Redmond theme.

All of the standard jQuery UI themes are hosted on the CDN.   Visit this page  to view thumbnails for each theme.

To learn more about the jQuery UI library, visit the official   jQuery UI website.



Third-Party Files on the CDN

The CDN hosts some of the most popular third party JavaScript libraries. Microsoft does not claim ownership of any third-party libraries hosted on this CDN. The copyright owners of the libraries are licensing these libraries to you. Any rights that you may have to download and use such libraries are granted solely by the respective copyright owners. Because these are not Microsoft libraries, Microsoft provides no warranties or intellectual property rights licenses (including no implied patent rights) for the third party libraries hosted on this CDN.  

jQuery Releases on the CDN

The following releases of jQuery are hosted on the CDN:  

jQuery version 1.7.1

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1-vsdoc.js

jQuery version 1.7

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7-vsdoc.js

jQuery version 1.6.4

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.4.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.4.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.4-vsdoc.js

jQuery version 1.6.3

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.3.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.3.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.3-vsdoc.js

jQuery version 1.6.2

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2-vsdoc.js

jQuery version 1.6.1

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1-vsdoc.js 

jQuery version 1.6

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6-vsdoc.js 

jQuery version 1.5.2

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.2.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.2.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.2-vsdoc.js 

jQuery version 1.5.1

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1-vsdoc.js 

jQuery version 1.5

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5-vsdoc.js 

jQuery version 1.4.4

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-vsdoc.js

jQuery version 1.4.3

  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.3.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.3.min.js
  • http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.3-vsdoc.js

jQuery version 1.4.2

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

jQuery version 1.4.1

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

jQuery version 1.4

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

jQuery version 1.3.2  

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







jQuery UI Releases on the CDN

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






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.  




jQuery Mobile Releases on the CDN

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






jQuery Templates Releases on the CDN

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


jQuery Cycle Releases on the CDN

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


jQuery DataTables Releases on the CDN

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


Modernizr Releases on the CDN

The following releases of   Modernizr  are hosted on the CDN:  

  • http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.0.6-development-only.js
  • http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-1.7-development-only.js

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.


Microsoft Files on the CDN

These libraries were uploaded by Microsoft.  

ASP.NET Web Forms and 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.aspnetcdn.com/ajax/mvc/1.0/MicrosoftMvcAjax.js
  • http://ajax.aspnetcdn.com/ajax/mvc/1.0/MicrosoftMvcAjax.debug.js 

ASP.NET MVC 2.0

  • http://ajax.aspnetcdn.com/ajax/mvc/2.0/MicrosoftMvcAjax.js
  • http://ajax.aspnetcdn.com/ajax/mvc/2.0/MicrosoftMvcAjax.debug.js 

ASP.NET MVC 3.0

  • http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.unobtrusive-ajax.js
  • http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.unobtrusive-ajax.min.js
  • http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.js
  • http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.min.js
  • http://ajax.aspnetcdn.com/ajax/mvc/3.0/MicrosoftMvcAjax.js
  • http://ajax.aspnetcdn.com/ajax/mvc/3.0/MicrosoftMvcAjax.debug.js 

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

你可能感兴趣的:(Microsoft)