friend connect

jay sean

Tuesday, October 26, 2010

jQuery UI on the Microsoft CDN


The jQuery UI team just added jQuery UI to the Microsoft Ajax Content Delivery Network (CDN). Thanks to them, you can start using jQuery UI in your ASP.NET websites by linking to jQuery UI at the following address:
http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/jquery-ui.js
You can start using the CDN now for free. No registration is required.
Using jQuery UI from the CDN can substantially improve the performance of your production ASP.NET websites. The Microsoft CDN is composed of servers distributed around the world. When users request a page from your website, the users can retrieve jQuery UI from a server located geographically close to them.
In addition, because browsers cache JavaScript files relative to a domain, serving jQuery UI from a CDN enables your website users to avoid downloading jQuery UI when visiting multiple websites. If you visit two websites that both use jQuery UI from the Microsoft CDN then the jQuery UI library only needs to be downloaded once.
Learn more about the Microsoft Ajax CDN by visiting the following website:
http://www.asp.net/ajaxlibrary/cdn.ashx
This website is being updated with the location of all of the jQuery UI library files.

Using the jQuery UI Datapicker from the Microsoft Ajax CDN

The jQuery UI Datepicker (http://jqueryui.com/demos/datepicker/) enables you to easily display a pop-up calendar. Here’s a complete code sample of using this plugin:
Listing 1 – Using the jQuery UI Datepicker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title>jQuery UI from Microsoft Ajax CDNtitle>
    <link type="text/css" rel="Stylesheet" href="http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/themes/redmond/jquery-ui.css" />
head>
<body>
    <form id="form1" runat="server">
    <div>
     
        <input id="startDate" />
  
    div>
    form>
    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js">script>
    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/jquery-ui.js">script>
    <script type="text/javascript">
        $("#startDate").datepicker();
  
    script>
body>
html>

When you open this page, and click (or tab) inside the input field, you get a popup calendar:
clip_image002
Notice that the page above includes the following link to a jQuery UI theme:
All of the standard jQuery UI themes are hosted on the Microsoft Ajax CDN. I am using the standard jQuery UI Redmond theme – naturally :).

Additional jQuery Plugins on the CDN

We are inviting the authors of the top jQuery plugins to add their plugins to the CDN. Pay attention to this blog over the next few months to learn about the new jQuery plugins added to the CDN.
I’m super excited about having jQuery UI on the Microsoft CDN. Having jQuery UI on the CDN will make it easier for ASP.NET developers to build ASP.NET applications that support rich and interactive user interfaces.

No comments:

Followers