<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web News &#187; web slices</title>
	<atom:link href="http://gogo.org.ua/tag/web-slices/feed" rel="self" type="application/rss+xml" />
	<link>http://gogo.org.ua</link>
	<description></description>
	<lastBuildDate>Tue, 08 Dec 2009 06:00:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Internet Explorer 8</title>
		<link>http://gogo.org.ua/internet-explorer-8</link>
		<comments>http://gogo.org.ua/internet-explorer-8#comments</comments>
		<pubDate>Wed, 11 Mar 2009 18:46:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Internet Explorer 8]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[web slices]]></category>

		<guid isPermaLink="false">http://gogo.org.ua/?p=13</guid>
		<description><![CDATA[Internet Explorer 8

 New Features To Slice, Store, And Accelerate Your Web Applications

Daron Yöndem


This article is based on a prerelease version of Internet Explorer 8. All information is subject to change.


In this article, I will look into the details of these features to see how Internet Explorer 8 can make life easier for both developers [...]]]></description>
			<content:encoded><![CDATA[<p class="FeatureSmallHead" align="center"><span style="font-family: trebuchet ms,geneva; font-size: large;"><strong>Internet Explorer 8</strong></span></p>
<p align="justify">
<p class="FeatureHeadline" align="center"><span style="font-family: trebuchet ms,geneva; font-size: large;"> <strong>New Features To Slice, Store, And Accelerate Your Web Applications</strong></span></p>
<p align="justify">
<p class="FeatureByLine" align="center"><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong>Daron Yöndem</strong><br />
</span></p>
<p align="justify"><!-- &#92&#92msdnmagtst&#92MTPS&#92MSDN&#92issues&#92en&#9209&#9203&#92Yodem.IE8.lay&#92default.xml --></p>
<p class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">This article is based on a prerelease version of Internet Explorer 8. All information is subject to change.</span></p>
<p align="justify">
<p align="justify">
<p id="id0100002" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">In this article, I will look into the details of these features to see how Internet Explorer 8 can make life easier for both developers and users alike. You&#8217;ll see how these new features allow you to define portions of a page and control its update frequency and expiration, improve the user&#8217;s search and navigation experience, and lots more.</span></p>
<p id="id0100002" class="ArticleNormalPara" align="right"><span style="font-family: trebuchet ms,geneva; font-size: small;"><a title="valant" href="http://valant.com.ua" target="_blank">valant</a></span></p>
<p id="id0100002" class="ArticleNormalPara" align="justify">
<p align="justify"><span id="more-13"></span><span style="font-family: trebuchet ms,geneva; font-size: small;"> </span></p>
<p id="id0100003" class="ArticleTypeTitle" align="justify"><strong><span style="font-family: trebuchet ms,geneva; color: #800080; font-size: small;">Defining Page Regions with Web Slices</span></strong></p>
<p align="justify">
<p id="id0100004" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Web Slices allow you to cut a Web page into pieces so that you can display and update only the parts you are interested in. Web Slices can be a handy solution for a user who wants to follow the updates from your Web site but doesn&#8217;t want to use an RSS reader. RSS readers can be a little complicated for some end users and are not always appropriate.</span></p>
<p align="justify">
<p id="id0100005" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Web Slices are programmatically defined parts of a Web page that users discover by moving their mouse over the slice or clicking the &#8220;Subscribe to a Web Slice&#8221; button on the toolbar. <strong>Figure 1</strong> shows this in action.</span></p>
<p align="justify">
<p class="ArticleImageCaptionText" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"><img src="http://i.msdn.microsoft.com/dd458804.fig01_L%28en-us%29.gif" alt="" width="598" height="372" /></span></p>
<p align="justify">
<p class="ArticleImageCaptionText" align="justify"><span style="color: #333399;">Fi</span><span style="color: #333399;">gure 1 <strong>Discovering a Web Slice by Hovering </strong></span></p>
<p align="justify">
<p id="id0100006" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">After subscribing to a Web Slice, the user will be able to see the slice title on the Internet Explorer 8 Favorites bar. Internet Explorer will keep contacting the online source and alert the user about updates by making the slice title text bold. When you click on the title, the content of the slice will be shown in a popup window as shown in <strong>Figure 2</strong>.</span></p>
<p align="justify">
<p class="ArticleImageCaptionText" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"><img src="http://i.msdn.microsoft.com/dd458804.fig02_L%28en-us%29.gif" alt="" /></span></p>
<p align="justify">
<p class="ArticleImageCaptionText" align="justify"><span style="color: #333399;">Figure 2 <strong>Finding the Latest Bid on an Auction in a Web Slice </strong></span></p>
<p align="justify">
<p id="id0100007" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">One major benefit of Web Slices is that users don&#8217;t need to keep refreshing a Web page in order to track changes on the site. Furthermore, depending on how you structure the data sources for your Web Slices, they can help to conserve resources on the Web server since updates will be for only relevant data, not the whole page. Additionally, by using Web Slices, your system can provide deeper statistics about how users access different parts of a Web page, which can impact further design decisions.</span></p>
<p align="justify">
<p id="id0100008" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">As I mentioned earlier, Web Slices are predefined by the developer. So how do you define those parts? First of all, you need to mark an HTML div element as a Web Slice container using the hslice class name. The hslice element will contain all the rest of the definitions you need for your Web Slice. Here&#8217;s an empty Web Slice definition:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;div class="hslice" id="ProductID1"&gt;  &lt;/div&gt;</span></pre>
<p id="id0100010" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Each Web Slice must have a unique ID, as this is how Internet Explorer distinguishes one from the other on a page. If the ID of a Web Slice changes after users subscribe to it, Internet Explorer will not be able to find it anymore and will not be able update the content on the favorites bar.</span></p>
<p align="justify">
<p id="id0100011" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Each Web Slice should contain an element to identify the title of the slice; the title is identified by the CSS class entry-title. This content will be shown on the favorites bar and the feed discovery command bar menu. The entry-title text can be changed if you like when the Web Slice updates itself.</span></p>
<p align="justify">
<p id="id0100012" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">To finish creating my first Web Slice I have to add just one more element: the entry-content. I have the Web Slice and the title defined but I don&#8217;t have any content to show to the user. So let&#8217;s define the Web Slice content by applying the CSS class entry-content on the content that should be displayed to the user:</span></p>
<pre style="border-color: #00ff00; border-left: 2px none #00ff00"><span style="font-size: small;">&lt;div class="hslice" id="ProductID1"&gt; </span></pre>
<pre style="border-color: #00ff00; border-left: 2px none #00ff00"><span style="font-size: small;">  &lt;h1 class="entry-title"&gt;   Brand New Product!&lt;/h1&gt;  </span></pre>
<pre style="border-color: #00ff00; border-left: 2px none #00ff00"><span style="font-size: small;">    &lt;div class="entry-content"&gt;    </span></pre>
<pre style="border-color: #00ff00; border-left: 2px none #00ff00"><span style="font-size: small;">    &lt;p&gt;     This is the product     definition.&lt;/p&gt;  </span></pre>
<pre style="border-color: #00ff00; border-left: 2px none #00ff00"><span style="font-size: small;">    &lt;/div&gt;</span></pre>
<pre style="border-color: #00ff00; border-left: 2px none #00ff00"><span style="font-size: small;">&lt;/div&gt;</span></pre>
<p id="id0100022" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong>Figure 3</strong> shows my Web Slice definition. My Web Slice, called ProductID1, has a title and content.</span></p>
<p align="justify">
<p class="ArticleImageCaptionText" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"><img src="http://i.msdn.microsoft.com/dd458804.fig03%28en-us%29.gif" alt="" width="366" height="229" /></span></p>
<p align="justify">
<p class="ArticleImageCaptionText" align="justify"><span style="font-family: trebuchet ms,geneva; color: #333399; font-size: small;">Figure 3 <strong>A Simple Web Slice </strong></span></p>
<p align="justify">
<p id="id0100023" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">You can add further richness to the Web Slice user experience with visual elements and inline (or global) CSS styles. The only limitation is that no scripting or ActiveX controls (including Silverlight) are allowed. If you need ActiveX ,you will need to use an alternative display source. An alternative display source can be defined on the entry-content container element of the Web Slice.</span></p>
<p align="justify">
<p dir="ltr" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">As shown here, you don&#8217;t need to put the content inside the entry-content element. You are simply redirecting the Web Slice and telling the browser that the content will come from another URL:<br />
</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;div class="hslice" id="ProductID2"&gt;     </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;h1 class="entry-title"&gt;      </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   Brand New Product&lt;/h1&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;div class="entry-content" href="http://www.contoso.com/web_slice/ alternative_display.aspx?ID=2"&gt;    </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;/div&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/div&gt;</span></pre>
<p id="id0100032" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">This way you will be able to track how many times each Web Slice is updated and how many users are following which slices by simply tracking the display source pages. In addition, in the target alternative_display.aspx page you are allowed to use ActiveX controls.</span></p>
<p align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"> </span></p>
<p id="id0100033" class="ArticleTypeTitle" align="justify"><span style="color: #800080;"><strong>E</strong></span><span style="color: #800080;"><strong>xpiration and Update Frequency</strong></span></p>
<p align="justify">
<p id="id0100034" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Sometimes you will need Web Slices to expire in a timely manner even if the user is offline and the Web Slice can&#8217;t get updated. This is especially true for sites such as online auctions or online sales campaigns. You can set the end time of a Web Slice by adding the endtime class name and the appropriate date time value inside an HTML abbreviation element, like so:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;div class="hslice" id="ProductID1"&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"> <span style="font-size: small;">    &lt;h1 class="entry-title"&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">       Brand New Product!&lt;/h1&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;div class="entry-content"&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;p&gt; This is the product definition.&lt;/p&gt;     </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;p&gt; This is the end time: &lt;abbr class="endtime"     title="2008-10-12T11:00:00-12:00:00"&gt;12:00&lt;/abbr&gt;&lt;/p&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;/div&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/div&gt;</span></pre>
<p id="id0100047" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Users are able to set the update frequency by right-clicking the Web Slice title on the favorites bar and clicking the Properties command. As shown in <strong>Figure 4</strong>, custom schedules are allowed.</span></p>
<p align="justify">
<p class="ArticleImageCaptionText" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"><img src="http://i.msdn.microsoft.com/dd458804.fig04_L%28en-us%29.gif" alt="" /></span></p>
<p align="justify">
<p class="ArticleImageCaptionText" align="justify"><span style="font-family: trebuchet ms,geneva; color: #333399; font-size: small;">Figure 4 <strong>Users Can Set the Update Frequency of a Web Slice </strong></span></p>
<p align="justify">
<p id="ctl00_mainContentContainer_ctl13_" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">In addition to the user-defined settings, you can programmatically specify frequencies by providing time to live (ttl) values:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;div class="hslice" id="ProductID6"&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;h1 class="entry-title"&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    Brand New Product!!!!&lt;/h1&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;div class="entry-content"&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;p&gt; This is the product definition.&lt;/p&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">       &lt;div class="ttl" style="display: none;"&gt;       15&lt;/div&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;/div&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/div&gt;</span></pre>
<p id="id0100059" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">To specify a frequency, I have created a DIV element with the CSS class ttl and the content 15. This tells the browser to check the content of this Web Slice every 15 minutes for possible updates. Notice that as a design choice I set the visibility of the DIV element to invisible by setting the display CSS value to none.</span></p>
<p align="justify">
<p id="id0100060" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">As I mentioned, you can use alternative display sources, but sometimes it can be useful to simply have a Web Slice fetch its data from an external data source. You have two choices when using external data sources. One option is to use an external Web Slice on another page, as you&#8217;ll see in the next code snippet.</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;div class="hslice" id="ProductID10"&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;div class="entry-title"&gt;         Product Name     &lt;/div&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;a rel="feedurl" href="http://www.contoso.com/         external.aspx#ProductID1"&gt;&lt;/a&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/div&gt;</span></pre>
<p id="id0100068" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">This Web Slice definition is pulling another Web Slice from external.aspx. The target Web Slice is found by its ID which is ProductID1 and attached as an anchor to the URL. The presence of the rel attribute on the anchor tag instructs Internet Explorer to use the anchor tag&#8217;s URL as the Web Slice data source rather than displaying the contents in the div tag.</span></p>
<p align="justify">
<p id="id0100069" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The second option is to use an external RSS feed. Internet Explorer will always use the first item inside the RSS feed and show the entry content from the incoming RSS XML:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;div class="hslice" id="ProductID10"&gt;    </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;div class="entry-title"&gt;         Product Name     &lt;/div&gt;     </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;a rel="feedurl" href="/slicefeed.xml"&gt;&lt;/a&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/div&gt;</span></pre>
<p id="id0100076" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Here the Web Slice has a feedurl anchor targeting an XML source, which could be easily replaced by a generic handler that outputs XML on the fly depending on some parameter. The XML source in our example is shown here:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;?xml version="1.0" encoding="utf-8" ?&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;rss version="2.0"&gt;   &lt;channel&gt;    </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;title&gt;WebSlice RSS&lt;/title&gt;    </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;ttl&gt;120&lt;/ttl&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;item&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;title&gt;Product Name Here&lt;/title&gt;     </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;description&gt;HTML &amp;lt;b&amp;gt;codes&amp;lt;/b&amp;gt; can be used&lt;/description&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;/item&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/channel&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/rss&gt;</span></pre>
<p id="id0100088" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Instead of defining the settings of our Web Slice in the entry-content HTML code, you can define them in your XML data source. In the previous code, the XML source provides values for ttl and title properties of a Web Slice. The description tag can contain rich HTML without causing any problems.</span></p>
<p align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"> </span></p>
<p id="id0100089" class="ArticleTypeTitle" align="justify"><span style="color: #800080;"><strong><span style="font-family: trebuchet ms,geneva; font-size: small;">Accelerators</span></strong></span></p>
<p align="justify">
<p id="id0100090" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Accelerators exist to make common tasks faster and more automated while browsing the Web. For example, think about how often you copy and paste content from one Web site to another. Let&#8217;s say you just found the address you were looking for on a corporate Web site and now you need driving directions. You copy the address, launch the Live Maps Web site and paste in the address. You can automate this process using an accelerator.</span></p>
<p align="justify">
<p id="id0100091" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong>Figure 5</strong> shows an Accelerator that finds a location on the map when the user clicks on the address. Writing your own accelerator is simple. As a developer, you just need to define what your accelerator will do using an XML OpenService Description file. Let&#8217;s dig into the details of the OpenService Description format. The following shows a basic OpenService Description file:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;?xml version="1.0" encoding="utf-8" ?&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;openServiceDescription xmlns="http://www.microsoft.com/schemas/   openservicedescription/1.0"&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;homepageUrl&gt;http://www.contoso.com/&lt;/homepageUrl&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;display&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;name&gt;Translate it with Contoso&lt;/name&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;icon&gt;http://www.contoso.com/favicon.ico&lt;/icon&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;/display&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;activity category="translate"&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    ...  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;/activity&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/openServiceDescription&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"></pre>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;"><img src="http://i.msdn.microsoft.com/dd458804.fig05_L%28en-us%29.gif" alt="" width="596" height="405" /></span></p>
<p><span style="color: #333399;">F</span><span style="color: #333399;">igure 5 <strong>Live Maps Accelerator Provides Instant Location Search </strong></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">The main properties of an Accelerator are the homepageUrl, display, and activity tags. The homepageUrl is the URL of the service you are providing. All the URLs used in other tags and settings should use the same domain as the homepageUrl. The display tag sets the visual aspects of an accelerator&#8217;s command button on the Internet Explorer right-click menu. When the user right-clicks on the page, the accelerator will be revealed by its name and icon.</span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">The activity element defines the service that the accelerator provides. In this example, the accelerator will provide a translation activity. You can control how Internet Explorer groups your accelerator on the context menu by using different categories like Add (to add a link), Blog (to blog on a remote service), Define (to look for definition), Map (to look for map) and Translate (to translate the selected text). You can also define your own categories. The suggested rules for category definitions are that they should be a verb and generic enough to let other accelerator developers use the same category.</span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">Now is the time to define our activitiyActions inside our activity tags. Here you can see one activityAction with a context value of selection:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;activityAction context="selection" &gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;preview action="http://www.contoso.com/translateacc.aspx" method=" get" &gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;parameter name="word" value="{selection}" /&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;/preview&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">       &lt;execute action=" http://www.contoso.com/translate.aspx " method=" post" &gt;      </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">         &lt;parameter name="word" value="{selection}" /&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">       &lt;/execute&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/activityAction&gt;</span></pre>
<p id="id0100115" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The context attribute is the key component of an activityAction. The context defines when this action will be available. If the accelerator doesn&#8217;t provide an action suitable for the current context, it will not be visible on the accelerator&#8217;s menu in Internet Explorer. The current context choices are selection and link. If the context is selection, the user needs to select text and go to the accelerators menu in order to use your accelerator. If the context is link, the user should right-click on a hyperlink to start the action.</span></p>
<p align="justify">
<p id="id0100116" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">In each activityAction you can have an execute and a preview definition. Execute is launched when the user clicks the accelerator command from the accelerators menu. Preview action is launched when the user hovers the mouse over the accelerator command on the menu. Both the Preview and Execute tags can have an action URL and a method. You can use GET or POST as methods of data transfer.</span></p>
<p align="justify">
<p id="id0100117" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Parameters are defined for each action as name/value pairs. The values come automatically from keywords in brackets. For instance, {selection} means that the text selected by the user will be the value of the associated parameter. </span></p>
<p id="id0100118" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The preview window works like an IFrame, which means that you can use any kind of interaction inside the preview window. It is more appropriate to design a specific interface and distinguish the preview and execute action URLs.</span></p>
<p align="justify">
<p id="id0100119" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The final OpenService Description file for the example is shown in <strong>Figure 6</strong>. Now it&#8217;s time to let the visitor of our Web site install this accelerator to her PCs. Here is the script needed to install the accelerator:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;div&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;input id="Button1" type="button" </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">       value="Click to Install"   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">      onclick="window.external.AddService('myaccelerat.xml');" /&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/div&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"></pre>
<p><span style="font-family: trebuchet ms,geneva; color: #333399; font-size: small;"><img id="ctl00_mainContentContainer_cpe425641_i" class="LibC_c" style="border-width: 0px; vertical-align: middle" src="http://i.msdn.microsoft.com/Global/Images/clear.gif" alt="" /> Figure 6 <strong>The Final OpenService Description File</strong></span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;?xml version="1.0" encoding="utf-8" ?&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;openServiceDescription xmlns="http://www.microsoft.com/schemas/   openservicedescription/1.0"&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;homepageUrl&gt;http://www.contoso.com/&lt;/homepageUrl&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;display&gt;     </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;name&gt;Translate with Contoso&lt;/name&gt;     </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;icon&gt;http://www.contoso.com/favicon.ico&lt;/icon&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;/display&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;activity category="translate"&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;activityAction context="selection" &gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;preview action="http://www.contoso.com/translate.asp"&gt;    </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">       &lt;parameter name="Word" value="{selection}" /&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;/preview&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;execute action="http://www.contoso.com/translate.asp"&gt;      </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;parameter name="Word" value="{selection}" /&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;/execute&gt;    </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;/activityAction&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;/activity&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;/openServiceDescription&gt;</span></pre>
<p id="id0100125" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The AddService method gets the URL of our OpenService Description XML file and starts the installation. In order to find out if an accelerator is already installed you can call the isServiceInstalled method.</span></p>
<p align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"> </span></p>
<p id="id0100126" class="ArticleTypeTitle" align="justify"><span style="color: #800080;"><strong><span style="font-family: trebuchet ms,geneva; font-size: small;">Search Suggestions</span></strong></span></p>
<p align="justify">
<p id="id0100127" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Internet Explorer 7.0 introduced a new feature called Search Providers. Users were able to integrate different search providers into their browser and use the search bar to easily navigate to their favorite search engine. This is possible because of the XML-based OpenSearch specification files. Internet Explorer 8 further improves search with a feature called search suggestions. As the name implies, the browser makes suggestions while you type your search keyword.</span></p>
<p align="justify">
<p id="id0100128" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">As the user types, the browser goes to the selected search suggestions provider and requests suggestions related to the search keywords. The resulting data is instantly shown to the user to create a better search experience (see <strong>Figure 7</strong>).</span></p>
<p align="justify">
<p class="ArticleImageSpacer" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"><img src="http://i.msdn.microsoft.com/dd458804.fig08_L%28en-us%29.gif" alt="" width="603" height="377" /></span></p>
<p align="justify">
<p class="ArticleImageCaptionText" align="justify"><span style="font-family: trebuchet ms,geneva; color: #333399; font-size: small;">Figure 7 <strong>Easily Access Suggestions for Search Keywords without Navigating Away from Current Page </strong></span></p>
<p align="justify">
<p id="id0100129" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Before getting into the details of how Search suggestions work, you will need a search provider. A search provider consists of three main elements: a name, a search URL, and an icon. Those are all well defined in the OpenSearch specification XML. The following is a full-featured search provider written for Internet Explorer 7.0 without search suggestions:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;?xml version="1.0" encoding="UTF-8"?&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;ShortName&gt;Contoso Search&lt;/ShortName&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;Url type="text/html" template="http://www.contoso.com/?key2search=     {searchTerms}"/&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;Image height="16" width="16" type="image/icon"&gt;     http://www.contoso.com/favicon.ico&lt;/Image&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/OpenSearchDescription&gt;</span></pre>
<p id="id0100138" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The ShortName tag includes the search provider name and the URL tag defines the search path of the search engine. The searchTerms keyword in the URL pattern will be replaced by the search keywords written by the user. Finally, the Image tag points to an icon file for the search provider.</span></p>
<p align="justify">
<p id="id0100139" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">In order to install a search provider, users will need to click an HTML element on your page or discover the search provider through the search box of Internet Explorer 8. And in a similar manner as accelerators, search providers can be installed using the window.external.AddSearchProvider JavaScript function:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;a href="#" onclick="window.external.AddSearchProvider('http://     </span><span style="font-size: small;">www.contoso.com/provider.xml')"&gt;  Add Search Provider  &lt;/a&gt;</span></pre>
<p id="id0100142" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Note that the AddSearchProvider JavaScript function requires the OpenSearch XML file URL as a parameter in order to initialize the install process.</span></p>
<p align="justify">
<p id="id0100143" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">As an alternative to the explicit reference to your OpenSearch XML file, you can let the browser explore your Web page and discover your search provider. To make your search provider discoverable, you will need to put a hidden link to your OpenSearch XML file in your HTML pages header. The following is a hidden link to a search provider:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;link title="Contoso Search" rel="search" type="application/ opensearchdescription+xml" href="http://www.contoso.com/provider.xml" /&gt;</span></pre>
<p id="id0100146" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The title of the link is the name of the search engine shown in the browser. The rel and type properties of the hidden link should be exactly the same as I&#8217;ve used here. This is how the browser knows that it is a link to a search provider. Finally, the href attribute contains a URL to the OpenSearch description XML file.</span></p>
<p align="justify">
<p id="id0100147" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Now that you have your Search Provider ready, you can go on and add search suggestions to it. First, you will need to modify the OpenSearch description XML file and specify your search suggestion data source:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;?xml version="1.0" encoding="UTF-8"?&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;OpenSearchDescription </span><span style="font-size: small;">xmlns="http://a9.com/-/spec/opensearch/1.1/"&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;ShortName&gt;Contoso Search&lt;/ShortName&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;Url type="text/html" template="http://www.contoso.com/?key2search=     {searchTerms}"/&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;Url type="application/x-suggestions+json" template="http://   www.contoso.com/json.ashx? key2search ={searchTerms}"/&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;Image height="16" width="16" type="image/icon"&gt;http://    www.contoso.com/favicon.ico&lt;/Image&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/OpenSearchDescription&gt;</span></pre>
<p id="id0100158" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Here you will see that I&#8217;ve added one additional line of XML to the previous search provider description file—a new URL tag with a different type value. In order to use the search suggestions feature, you will need a service that can evaluate the search keywords being provided by the user and is able to supply the appropriate suggestion list.</span></p>
<p align="justify">
<p id="id0100159" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The list can be provided in XML or JSON format. In the example, I have added pointers to the suggestion service using JSON. However, I could have easily consumed an XML-based service with the following XML:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;Url type="application/x-suggestions+xml" template="http://   www.contoso.com/xml.ashx?    key2search  ={searchTerms}"/&gt;</span></pre>
<p id="id0100163" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">There are important differences between XML and JSON data sources. A JSON data source can provide a list of suggestions including the suggested results, one description for each result and a URL if needed. Here&#8217;s an example:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">["con", </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">["contoso soft", "contoso books", "contoso rent"],</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">["software company", "book store", "rent a car"], </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">["http://www.contoso.com/soft",</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> "http://www.contoso.com/books", </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">"http://www.contoso.com/rent"]]</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"></pre>
<p><span style="font-family: trebuchet ms,geneva; color: #333399; font-size: small;">Figure 8 <strong>XML for Search Suggestions</strong></span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;SearchSuggestion&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;Query&gt;con&lt;/Query&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;Section title="First Section"&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">         &lt;Item&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">             &lt;Text&gt;Result 1&lt;/Text&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">             &lt;Description&gt;Description 1&lt;/Description&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">             &lt;Url&gt;http://www.contoso.com?id=1&lt;/Url&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">         &lt;/Item&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">         &lt;Separator title="Others"/&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">         &lt;Item&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">             &lt;Text&gt;Result 2&lt;/Text&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">             &lt;Description&gt;Description 2&lt;/Description&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">             &lt;Url&gt;http://www.contoso.com?id=2&lt;/Url&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">         &lt;/Item&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;/Section&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;/SearchSuggestion&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-family: trebuchet ms,geneva; color: #333399; font-size: small;">Figure 9 <strong>A Sample Search Suggestion List </strong></span></pre>
<p class="imgleft" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"><img src="http://i.msdn.microsoft.com/dd458804.fig10%28en-us%29.gif" alt="" /></span></p>
<p align="justify">
<p id="id0100168" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Internet Explorer 8 will pull the JSON data on the fly and show the autocomplete list instantly. Be aware that the search keyword should be included in the data returned from the provider. The first element in our JSON example contains our search keyword &#8220;con.&#8221;</span></p>
<p align="justify">
<p id="id0100169" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">If you choose to use the XML format to provide search suggestion lists for Internet Explorer, you will be able to choose a title for your result list, to split the results with separators, and to provide visual suggestions as well.</span></p>
<p align="justify">
<p id="id0100170" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">At first I will provide a Search suggestion list with only two results and one separator. The XML response in <strong>Figure 8</strong> contains the submitted keyword in the Query tags and provides two Items in a Section tag. The section tag has a title and each item has a Text, Description and a Url to navigate.</span></p>
<p align="justify">
<p id="id0100171" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">You can use separator tags with titles to provide different lists of results in the search suggestion box. The URLs will be used when the user clicks a suggested item in the list. In <strong>Figure 9</strong>, you can see how the XML data will be shown in Internet Explorer 8.</span></p>
<p align="justify">
<p dir="ltr" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">In addition to the classical view of a search suggestion list, you can use images to enhance the user experience and provide an image with each suggestion. All you need to do is and add an Image tag to the appropriate Item tags, like so:<br />
</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;Item&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> &lt;Text&gt;Result 1&lt;/Text&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;Description&gt;Description 1&lt;/Description&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;Url&gt;http://www.contoso.com?id=1&lt;/Url&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;Image Source=http://www.contoso.com/image.jpg     alt="A picture is worth thousand words" width="70"&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;/Image&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/Item&gt;</span></pre>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;"> </span></p>
<p id="id0100180" class="ArticleTypeTitle" align="justify"><span style="color: #800080;"><strong><span style="font-family: trebuchet ms,geneva; font-size: small;">AJAX Navigation</span></strong></span></p>
<p align="justify">
<p id="id0100181" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">AJAX is one of the major components of rich Internet applications (RIA) and will remain so as long as HTML is in use. You can use AJAX to update pieces of the UI without requiring entire page refreshes and server-client cycles for each user action. But AJAX has its drawbacks.</span></p>
<p align="justify">
<p id="id0100182" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">When you use AJAX to modify your Web page content you will notice that the address bar doesn&#8217;t change. This makes sense. But what if the user wants to have a consistent URL of the current page&#8217;s state, say for adding to favorites and so forth? What if the user clicks the back button in her browser? She will be sent to the Web site she visited previously.</span></p>
<p align="justify">
<p id="id0100183" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Somehow you have to reflect the URL change without refreshing the Web site. Enter the fragment identifier. The fragment identifier does exactly what it sounds like it does—identifies the state of part of the page.</span></p>
<p align="justify">
<p id="id0100184" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Each URL can have a fragment identifier; you just need to append a pound sign &#8220;#&#8221; to the end of the URL (for example, www.contoso.com/default.aspx#5). If you change the content after the # sign, the Web page will not refresh but the history log of the browser will record the change and provide back and forth navigation.</span></p>
<p align="justify">
<p id="id0100185" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">In Internet Explorer 8, this feature is provided with the window.location.hash property and the new hashChanged event. Whenever you change the window.location.hash property, the address bar will get an update and the content of the hash property will be placed after the # sign. When the user tries to navigate to another Web page through the browsers buttons, the hashChanged event will fire and provide the target hash value which is the value after the target pages # sign.</span></p>
<p align="justify">
<p id="id0100186" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Let&#8217;s create a simple Web site with a WebMethod in order to service AJAX calls. This sample Web site will contain an HTML button and a DIV element. Each time someone clicks the HTML button, the numeric content of the DIV element will be sent to the WebMethod:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;form id="form1" runat="server"&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;asp:ScriptManager EnablePageMethods="true" ID="ScriptManager1"          runat="server"&gt;     </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;/asp:ScriptManager&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;div&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    &lt;input id="Button1" onclick="GetNext();" type="button" value="button" /&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">      &lt;div id="content"&gt;0&lt;/div&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;/div&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/form&gt;</span></pre>
<p id="id0100196" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">In order to call the service, add the following JavaScript:</span></p>
<p align="justify">
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">function GetNext() {  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   PageMethods.GetNext($get("content").innerHTML, Done); } </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">function Done(sender) {  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  $get("content").innerHTML = sender;     window.location.hash = sender;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">}</span></pre>
<p id="id0100204" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Finally, create the WebMethod in the page&#8217;s codebehind file in order to increment the integer parameter and return it to the AJAX caller:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;System.Web.Services.WebMethod()&gt; _ </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">Public Shared Function GetNext(ByVal x As Integer) As Integer   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">Return x + 1 End Function</span></pre>
<p id="id0100209" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The JavaScript method named GetNext makes an XMLHttpRequest to the server. The parameters for the GetNext method are simply the content of the DIV element and a callback method. When the callback method, Done, is called as a result of the service response, the new value is simply put back into the DIV element.</span></p>
<p align="justify">
<p id="id0100210" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Here comes the interesting point. After modifying the Web page with the new content, I assign a unique identifier to the window.location.hash property in order to identify the current state of my Web page. For this simple example, that value is the same number displayed in my DIV element. After changing the hash property, if you take a look in the browser history you will notice the new entries that are now listed there.</span></p>
<p align="justify">
<p id="id0100211" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Whenever the user navigates back or forward in the browser history, the hash property will be handed back to a JavaScript function that handles the onhashchange event. This is accomplished using the following line of code:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;body onhashchange="HashChanged();"&gt;</span></pre>
<p id="id0100213" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">This function will be called whenever the user navigates backward or forward, and Internet Explorer 8 will update the window.location.hash property according to the values in the browser history. This enables me to easily get the hash value and update my page, whether that action is as simple as updating the page with the hash data itself, as shown below or whether it involves requesting data from the server based on a unique identifier stored in the hash:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">function HashChanged() {   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   $get("content").innerHTML = window.location.hash;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">}</span></pre>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;"> </span></p>
<p id="id0100217" class="ArticleTypeTitle" align="justify"><span style="color: #800080;"><strong><span style="font-family: trebuchet ms,geneva; font-size: small;">DOM Storage</span></strong></span></p>
<p align="justify">
<p id="id0100218" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Currently, if you need to store data on the client, the only standardized way, and the old standby, is to use document.cookie. Unfortunately, this method is simply not flexible or powerful enough for today&#8217;s online applications. One of the most significant shortcomings of cookies is the 4KB limit. Internet Explorer 8 has an answer—DOM storage.</span></p>
<p align="justify">
<p id="id0100219" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">DOM storage is part of the HTML 5 Working Draft and provides a huge data store (about 10MB) on the client side. This storage can be so much larger in part because the data is not sent with each request to the server as it is with cookies. Plus, the localStorage never expires.</span></p>
<p align="justify">
<p id="id0100220" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">In order to store and retrieve data from DOM storage, all you need is a key/value pair. The localStorage JavaScript class provides the methods setItem, getItem and removeItem to access all the features of DOM Storage:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">function Save() { </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    localStorage.setItem("MyItem", $get("Text1").value);} </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">function Load() { </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">    $get("Text1").value = localStorage.getItem("MyItem"); </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">}</span></pre>
<p id="id0100227" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">This code performs the equivalent of a property get and set operation in C# or Visual Basic using DOM Storage as the backing store. First of all, the Save function stores the value of a TextBox to DOM Storage with a key name of MyItem. Then the Load function retrieves the data from DOM Storage by providing the same key name.</span></p>
<p align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"> </span></p>
<p id="id0100228" class="ArticleTypeTitle" align="justify"><span style="color: #800080;"><strong><span style="font-family: trebuchet ms,geneva; font-size: small;">Offline and Online Working Modes</span></strong></span></p>
<p align="justify">
<p id="id0100229" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">Like many Web developers, I&#8217;ve long been dreaming of the day when I could detect if the current user has a healthy connection to the Internet and provide an appropriate level of functionality. Now, Internet Explorer 8 provides the status of the host PCs Internet connection with onLine property of window.navigator. While in the past, this property represented whether the user had chosen to work offline, it now indicates whether the current user has an established connection to the network.</span></p>
<p align="justify">
<p id="id0100230" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">In addition to the onLine property, Internet Explorer 8 has now two new callback handlers ononline and onoffline. The onoffline handler is raised when the system loses the network connection and the ononline handler is raised when the connection is restored. You can attach event listeners and be warned instantly about the state of the connection so that you can provide you users a blended experience during both online and offline functionality.</span></p>
<p align="justify">
<p id="id0100231" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong>Figure 10</strong> shows a simple usage of ononline and onoffline events defined in the body of a Web page. Each time the user gets connected to the network, the Online JavaScript method will launch. Likewise, each time the users disconnects, the network the Offline method will fire.</span></p>
<p align="justify">
<p dir="ltr" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;"> </span><span style="color: #333399; font-size: small;"><img id="ctl00_mainContentContainer_cpe425643_i" class="LibC_c" style="border-width: 0px; vertical-align: middle" src="http://i.msdn.microsoft.com/Global/Images/clear.gif" alt="" /> Figure 10 <strong>Using Ononline and Onoffline Events </strong></span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;html &gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">  &lt;head runat="server"&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;title&gt;&lt;/title&gt;  </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">      &lt;script type="text/javascript" language="javascript"&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">      function Online() {             alert("I'm online");         }    </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     function Offline() {             alert("I'm offline");         }     </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;/script&gt;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;/head&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;body ononline="Online();" onoffline="Offline();"&gt;    </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;form id="form1" runat="server"&gt;   </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     &lt;/form&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">   &lt;/body&gt; </span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">&lt;/html&gt;</span></pre>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;"> </span></p>
<p id="id0100232" class="ArticleTypeTitle" align="justify"><span style="color: #800080;"><strong><span style="font-family: trebuchet ms,geneva; font-size: small;">XMLHttpRequest Time Outs</span></strong></span></p>
<p id="id0100233" class="ArticleNormalPara" align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">The new XMLHttpRequest in Internet Explorer 8 has a TimeOut property and an ontimeout event. This enables you to define XMLHttpRequests which will timeout and allow other requests to move ahead in the request queue.In the following code, I create a new XmlHttpRequest a</span><span style="font-family: trebuchet ms,geneva; font-size: small;">nd set the timeout property and ontimeout event listener:</span></p>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">function GetAReqeust() {</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     var MyRequest = XMLHttpRequest();</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     MyRequest.ontmeout = TimeOutHere;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     MyRequest.open("GET","http://www.contoso.com/data.xml");</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     MyRequest.timeout = 2000;</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     MyRequest.send(null);}</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> function TimeOutHere() {</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;">     alert("Request to Contoso timed out!");</span></pre>
<pre class="libCScode" style="white-space: pre-wrap"><span style="font-size: small;"> }</span></pre>
<p align="justify"><span style="font-family: trebuchet ms,geneva; font-size: small;">As you can see, Internet Explorer 8 offers a number of features that solve many problems Web developers have been hoping to solve for a long time. Whether it&#8217;s in more deeply integrating your content and services into the browser or leveraging new browser platform services to provide for a more seamless user experience, Internet Explorer 8 gives you the tools to build richer, mo</span><span style="font-family: trebuchet ms,geneva; font-size: small;">re seamless experiences for your users.</span></p>
<p align="justify">
<p align="right"><a title="valant" href="http://valant.com.ua" target="_blank"><strong><span style="font-family: trebuchet ms,geneva; font-size: small;">valant </span></strong></a></p>
<a href='javascript: void(0);' onclick="window.open('http://gogo.org.ua/wp-content/plugins/email_post/email_post_process_link.php?&email_post_link_id=13','popup_mailform',
    'toolbar=0,status=0,menubar=0,scrollbars=1,resizable=0,width=630,height=600, top=0, left=0')"><img src='http://gogo.org.ua//wp-content/plugins/email_post/email_post.gif' style='border: 0px none;' /></a>&nbsp;<a href='javascript: void(0);' onclick="window.open('http://gogo.org.ua/wp-content/plugins/email_post/email_post_process_link.php?&email_post_link_id=13','popup_mailform',
    'toolbar=0,status=0,menubar=0,scrollbars=1,resizable=0,width=630,height=600, top=0, left=0')">Mail this post</a>]]></content:encoded>
			<wfw:commentRss>http://gogo.org.ua/internet-explorer-8/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
