<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://siteexperts.spaces.live.com/mmm2008-07-24_12.50/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fsiteexperts.spaces.live.com%2fcategory%2fWeb%2bDevelopment%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Scott's "SiteExperts" Place: Web Development</title><description /><link>http://siteexperts.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=catWeb%2bDevelopment</link><language>en-US</language><pubDate>Thu, 28 Aug 2008 05:30:13 GMT</pubDate><lastBuildDate>Thu, 28 Aug 2008 05:30:13 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://siteexperts.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>-3572391539995137421</live:id><live:alias>siteexperts</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>Watch my Engineering Great AJAX Experiences Talk...</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4974.entry</link><description>&lt;div&gt;My presentation from the Mix06 Conference,&lt;a href="http://sessions.mix06.com/display_detail.asp?sessionChoice=2001&amp;amp;disc=&amp;amp;pid=NGW020&amp;amp;year=2005"&gt; Lessons from the Trenches: Engineering Great AJAX Experiences&lt;/a&gt; is &lt;a href="http://sessions.mix06.com/display_detail.asp?sessionChoice=2001&amp;amp;disc=&amp;amp;pid=NGW020&amp;amp;year=2005"&gt;now online&lt;/a&gt;:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;strong&gt;&lt;a href="http://sessions.mix06.com/display_detail.asp?sessionChoice=2001&amp;amp;disc=&amp;amp;pid=NGW020&amp;amp;year=2005"&gt;NGW020 - Lessons from the Trenches: Engineering Great AJAX Experiences&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/span&gt;&lt;br&gt;Explore the challenges and lessons learned developing the Windows Live and Gadgets Web client frameworks powering Windows Live, Hotmail (Kahuna beta), Spaces, and more. This technical talk presents design and architectural considerations for building interactive AJAX-like sites. See how componentization, network management, accessibility, page composition, and more impact the design and engineering of your Web application. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; (To find other talks, go to the main &lt;a href="http://sessions.mix06.com/"&gt;Mix06 Sessions Page&lt;/a&gt;).&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Watch+my+Engineering+Great+AJAX+Experiences+Talk...&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4974.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4974.entry</guid><pubDate>Thu, 04 May 2006 10:59:08 GMT</pubDate><slash:comments>35</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!4974/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4974.entry#comment</wfw:comment><dcterms:modified>2006-05-04T10:59:08Z</dcterms:modified></item><item><title>Gadgets and Cross-Browser Development</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4861.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;p&gt;We are working hard to improve the Gadget framework documentation. In the meantime (and as we improve documentation), I am working on a series of short tutorials, tips, and highlights introducing how to use the Gadget framework and the underlying APIs.  
&lt;p&gt;I am going to start with our compatibility layer. After exploring various third-party gadgets being developed for Live.com, I discovered that many developers are still struggling with the API differences between Firefox and Internet Explorer. Most common, I see various tricks to handle the event model differences where IE uses a global event object and Firefox passes the event object as an argument to your handler. 
&lt;p&gt;This is not necessary when you build Gadgets. Instead, you should be leveraging the underlying compatibility layer that is part of the overall Gadget framework. 
&lt;p&gt;As I posted last &lt;a href="http://spaces.msn.com/siteexperts/ http://spaces.msn.com/siteexperts/blog/cns!CE6C50D25BFAAA73!2000.entry"&gt;September&lt;/a&gt;, as we develop our properties, almost none of our application logic contains browser specific code. Instead, we develop once to the Internet Explorer API and our code runs without modification in Firefox. This occurs because we download a special script that emulates the most useful IE’isms inside of Firefox and in a few cases, Firefox/W3C’isms in Internet Explorer. In this article I highlight the most useful methods and properties of this layer (I promise we will develop a full reference in the near future). 
&lt;p&gt;&lt;b&gt;Event Model&lt;/b&gt; 
&lt;p&gt;This is easy – always attach events using attachEvent and detachEvent. Do not assign event handlers using function references (e.g., myElement.onclick = doThis) nor use the addEventListener approach. 
&lt;p&gt;In your event handlers, don’t worry – you will always get the global event object. For example: &lt;pre&gt;function doClick()
{
  alert(&amp;quot;You clicked on a &amp;quot; + event.srcElement.tagName + &lt;br&gt;     &amp;quot; element&amp;quot;);
}
document.body.attachEvent(“onclick”,doClick);&lt;/pre&gt;
&lt;p&gt;Also, as a general practice (I will cover this more in later articles but this is extremely important), when writing Gadgets, be sure to detach any event handlers in your dispose handler. Otherwise, your Gadget will leak memory due to known &lt;a href="http://spaces.msn.com/siteexperts/blog/cns!CE6C50D25BFAAA73!909.entry"&gt;browser issues&lt;/a&gt;. 
&lt;p&gt;What can you do with this event object? You can check out the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/obj_event.asp"&gt;MSDN reference&lt;/a&gt; as most properties are exposed. In addition to the standard properties, below are the list of properties we added to Firefox: 
&lt;ul&gt;
&lt;li&gt;srcElement 
&lt;li&gt;cancelBubble 
&lt;li&gt;offsetX 
&lt;li&gt;offsetY 
&lt;li&gt;x 
&lt;li&gt;y 
&lt;li&gt;returnValue 
&lt;li&gt;button (few issues as Firefox does not properly distinguish between the left button and no button) 
&lt;li&gt;fromElement 
&lt;li&gt;toElement &lt;/ul&gt;
&lt;p&gt;We have also gone further and extended Firefox with the very useful mouseenter and mouseleave events. As long as you attach these events using the attachEvent and detachEvent methods, these events fire just as they do in Internet Explorer. These events are very useful for quickly and easily detecting when a mouse enters or leaves a specific element. Again, check out the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events/onmouseenter.asp"&gt;MSDN reference&lt;/a&gt; for more details. 
&lt;p&gt;We even have a reasonable emulation of &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/setcapture.asp"&gt;mouse capturing&lt;/a&gt;. However, this is most useful in the context of an entire web-page not within a simple gadget. This is because mouse capturing in Firefox only fires within the context of the browser client area. Regardless, when using mouse capturing (setCapture and releaseCapture methods), the mouse events fire properly on the correct elements. 
&lt;p&gt;We also fixed the Firefox onclick event to only fire for the left mouse button (Firefox fired for all mouse buttons). This little difference could cause you grief in your application. (For those of you who noticed that we also accidentally prevented the ability to open pages in new tabs via the middle button, that will be fixed real soon). 
&lt;p&gt;&lt;b&gt;Useful Element Methods&lt;/b&gt; 
&lt;p&gt;Internet Explorer also supports a number of very helpful methods and properties on every element. These APIs simplify day-to-day programming and are very useful for building your application. Below are the list of element functions we added to Firefox. Again, check out MSDN for the details (linked for each item below) on how they work. 
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/click.asp"&gt;click() &lt;/a&gt;
&lt;li&gt;&lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/author/ dhtml/reference/methods/releasecapture.asp"&gt;setCapture(), releaseCapture() &lt;/a&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/insertadjacentelement.asp"&gt;insertAdjacentElement()&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/author/ dhtml/reference/collections/children.asp"&gt;children &lt;/a&gt;collection 
&lt;li&gt;&lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/author/ dhtml/reference/properties/parentelement.asp"&gt;parentElement &lt;/a&gt;property 
&lt;li&gt;&lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/author/ dhtml/reference/properties/innertext.asp"&gt;innerText &lt;/a&gt;property 
&lt;li&gt;&lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/author/ dhtml/reference/objects/currentstyle.asp"&gt;currentStyle &lt;/a&gt;property (see below) 
&lt;li&gt;&lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/ author/dhtml/reference/methods/swapnode.asp"&gt;swapNode() &lt;/a&gt;
&lt;li&gt;&lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/author/ dhtml/reference/methods/replacenode.asp"&gt;replaceNode() &lt;/a&gt;
&lt;li&gt;&lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/ author/dhtml/reference/methods/removenode.asp"&gt;removeNode&lt;/a&gt;() 
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/contains.asp"&gt;contains()&lt;/a&gt;&lt;/ul&gt;
&lt;p&gt;The currentStyle property returns the value actually being applied to the element. We currently support a subset of CSS attributes that we have found useful: border, margin, padding for Top, Left, Right, and Bottom; position; height; width; zIndex; color; and direction. We will most likely extend this list over time. 
&lt;p&gt;&lt;b&gt;Useful style properties&lt;/b&gt; 
&lt;p&gt;We also extended the properties available on the style object with the extremely useful &lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/author/ dhtml/reference/properties/pixeltop.asp"&gt;pixel&lt;/a&gt;* properties. These allow you to easily manipulate the dimensions of the element (assuming you are working with pixels). We also added the &lt;a href="http://spaces.msn.com/siteexperts/msdn.microsoft.com/workshop/ author/dhtml/reference/properties/csstext.asp"&gt;cssText &lt;/a&gt;property which gives you a serialized representation inline style. 
&lt;p&gt;&lt;b&gt;XPath Expressions&lt;/b&gt; 
&lt;p&gt;When dealing with XML documents the ability to query for specific nodes is especially useful. Trying to decipher the difference between IE and Firefox for querying XML can be extremely painful. So, we provided support for two very straighforward IE methods, selectSingleNode and selectNodes. 
&lt;p&gt;&lt;b&gt;Creating xmlHttp Objects&lt;/b&gt; 
&lt;p&gt;When you need to create a new XML Http Object, you can now simply use the standard approach, &lt;code&gt;var y = new xmlHttpRequest()&lt;/code&gt;. However, as I will cover in future articles, I highly recommend you leverage our built-in network stack for all your network requests. 
&lt;p&gt;&lt;b&gt;Parsing XML&lt;/b&gt; 
&lt;p&gt;Last, but not least, you have a string that you want to load into an XML DOM - just use the standard DOM Parser object: &lt;pre&gt;var dp = new DOMParser(); 
var xmlDom = dp.parseFromString(yourXMLString); 
&lt;/pre&gt;
&lt;p&gt;This concludes my very brief and fast introduction to our compatibility layer. We are continually expanding the functionality. For example, we have basic IE filter support (alpha filters assigned via script will also apply in Firefox). I will cover these in later posts. For now, resist the urge in your Gadgets to author code differently for each browser. Instead, take the easy road and let our compatibility layer do all your heavy lifting.
&lt;p&gt;Last, since it will inevitably come up, see the &lt;a href="http://spaces.msn.com/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!1925.entry"&gt;following post &lt;/a&gt;on why we support or don't support other browsers (while the post talks about start.com it is relevant to all properties on our framework).&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Gadgets+and+Cross-Browser+Development&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4861.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4861.entry</guid><pubDate>Thu, 27 Apr 2006 06:35:01 GMT</pubDate><slash:comments>61</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!4861/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4861.entry#comment</wfw:comment><dcterms:modified>2006-04-27T06:57:46Z</dcterms:modified></item><item><title>Presentation: Creating Rich Interactive Web Applications Using Ajax</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4087.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;div&gt;About 2 weeks ago (on January 25th), I gave a presentation on Creating Rich Interactive Web Applications Using AJAX.  I just posted the deck at &lt;a href="http://www.weblogging.com/decks/ajax.ppt"&gt;http://www.weblogging.com/decks/ajax.ppt&lt;/a&gt;.  The deck is mostly intended for the attendees as the slides by themselves do not convey the full intent of the talk.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;For those that missed the talk, I will be giving a similar talk at the &lt;a href="http://www.mix06.com/"&gt;Mix06 &lt;/a&gt;Conference in March:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Lessons from the Trenches: Engineering Great AJAX Experiences&lt;/strong&gt;&lt;br&gt;
&lt;div&gt;Explore the challenges and lessons learned developing the Windows Live and Gadgets Web client frameworks powering Windows Live, Hotmail (Kahuna beta), Spaces, and more. This technical talk presents design and architectural considerations for building interactive AJAX-like sites. See how componentization, network management, accessibility, page composition, and more impact the design and engineering of your Web application.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The focus of the talk is to look well beyond AJAX to explore challenges in designing and engineering your web application. I believe the paradigm shift is not so much focused on AJAX (which is merely a development pattern) but rather around the ability to remix and mashup the web.  The remix concept is fundamental to how we are architecting our experiences across Windows Live.  This talk explores the web client technical issues that need to be considered when building a rich (remixable) web-experience.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Presentation%3a+Creating+Rich+Interactive+Web+Applications+Using+Ajax&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4087.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4087.entry</guid><pubDate>Tue, 07 Feb 2006 07:05:50 GMT</pubDate><slash:comments>63</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!4087/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4087.entry#comment</wfw:comment><dcterms:modified>2006-02-07T07:05:50Z</dcterms:modified></item><item><title>I am presenting at the WebGuild user group next week</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4025.entry</link><description>&lt;div&gt;If you are in the valley, feel free to join me Wednesday, January 25th, at the WebGuild user group (&lt;a href="http://www.webguild.org"&gt;http://www.webguild.org&lt;/a&gt;).  I am giving a talk on Building Rich Interactive Web Aapplications using Ajax.  I will share design and engineering challenges that should be considered when building AJAX-like sites. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+I+am+presenting+at+the+WebGuild+user+group+next+week&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4025.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4025.entry</guid><pubDate>Sat, 21 Jan 2006 19:15:51 GMT</pubDate><slash:comments>29</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!4025/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!4025.entry#comment</wfw:comment><dcterms:modified>2006-01-21T19:15:51Z</dcterms:modified></item><item><title>Mix06 Conference</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!3854.entry</link><description>&lt;div&gt;I promise I will get back to blogging more real soon :-)&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I wanted to point out the &lt;a href="http://www.mix06.com/"&gt;Mix06 Conference&lt;/a&gt;.  If you do anything web-related (e.g., Web 2.0, Ajax, etc) I recommend joining us for a conversation exploring the MIXed up world of the web.  I will blog more about this over the next few months.  I will be there most likely presenting and joining in on many of the conversations.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Mix06+Conference&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!3854.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!3854.entry</guid><pubDate>Thu, 15 Dec 2005 21:52:30 GMT</pubDate><slash:comments>32</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!3854/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!3854.entry#comment</wfw:comment><dcterms:modified>2005-12-15T21:55:34Z</dcterms:modified></item><item><title>Technology and Windows Live</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2874.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;p&gt;Yesterdays Live.com demonstrations and announcements had a few hiccups. Since I take a long-term perspective, I am sure yesterdays missteps will be quickly forgotton. As we execute moving forward, the commitment to and value of this vision will become even clearer. 
&lt;p&gt;My focus is on executing and developing the technology to enable the Live.com vision. Over the past nine months, I have been discussing (from a technical perspective) the benefits and value in developing the shared MSN framework and set of programming patterns. If you look at MSN and Live.com's direction, you will start to see the benefits of this investment. Live.com and many MSN.com properties are now built on the same client infrastructure. Having a single framework will enable improved and consistent experiences to be delivered with more stability and efficiency. 
&lt;p&gt;The model extends to third-party developed Microsoft Gadgets. Microsoft Gadgets use the same programming paradigm used internally to build our properties. Gadgets are built on the same base classes as our native components and have access to the same set of services and functionality. 
&lt;p&gt;We are going to see lots of other benefits of having a shared framework. Picking on one shortcoming - we currently do not provide adequate integration (actually no integration) with the back button. We will be adding history support into the infrastructure. The benefit to having a shared framework is once functionality is ready, it can be leveraged universally in a consistent manner across all our properties (and even leveraged by third-party Live.com Gadgets). 
&lt;p&gt;Beyond MSN and Windows Live, the framework shares the same foundation as ASP.net Atlas. Asp.Net Atlas enables you to build and host your own rich applications. This is much broader than a mere AJAX library - this is establishing an entire platform and approach with tools support to building web applications. 
&lt;p&gt;Technology, experience, customer value, etc. - everything is coming together. Remember, yesterday was a small and important step representing a fundamental shift in direction at Microsoft. 
&lt;p&gt;It is what comes next that gets me excited...&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Technology+and+Windows+Live&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2874.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2874.entry</guid><pubDate>Wed, 02 Nov 2005 22:55:07 GMT</pubDate><slash:comments>33</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!2874/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2874.entry#comment</wfw:comment><dcterms:modified>2005-11-03T04:48:14Z</dcterms:modified></item><item><title>XMLHttpRequest - The Ultimate Outliner (Almost)</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2776.entry</link><description>&lt;div style="font-size:115%"&gt;A key part of Web 2.0 focuses around the ability to mash-up or remix the web. Unfortunately, I believe the cross-domain limitations of the xmlhttprequest object are lmiting opportunities. By enabling (at minimum) unauthenticated cross-domain requests much greater innovation can be achieved. For background, I recommend starting with my earlier blog entries: &lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!2332.entry"&gt;XMLHttpRequest - Eliminating the Middleman&lt;/a&gt;, and &lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!2085.entry"&gt;XMLHttpRequest - Do you trust me?&lt;/a&gt;.&lt;/div&gt;
&lt;div style="font-size:115%"&gt; &lt;/div&gt;
&lt;div style="font-size:115%"&gt;So how do I make my point? I build a few 100% client-side demonstrations. In my last article, I enabled &lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!2332.entry"&gt;multiple search engine&lt;/a&gt; querying. This week, I attempt to prototype an &amp;quot;ultimate outliner&amp;quot; that can consume OPML, RSS, Atom, etc. I limit myself to two hours from imagining the idea to posting an implementation.  I am confident it is very difficult to recreate these demos as cheaply or easily (especially from a bandwidth and scalability perspective) if I did not request the cross-domain resources from the client.&lt;/div&gt;
&lt;div style="font-size:115%"&gt; &lt;/div&gt;
&lt;div style="font-size:115%"&gt;Where's the demo? See &lt;a href="http://weblogging.com/o/"&gt;http://weblogging.com/o/&lt;/a&gt;.  You can enter a RSS, Atom, or OPML feed or pass it in directly via the URL: http://weblogging.com/o/?pathToFeed. Below are a few you can try out (be sure to follow the security instructions if this is your first time using my demonstrations):&lt;/div&gt;
&lt;div style="font-size:115%"&gt;
&lt;ul&gt;
&lt;li&gt;CNet Top 100 Blogs (Hopefully I will be listed next time :-)&lt;br&gt;&lt;a href="http://weblogging.com/o/?http://news.com.com/html/ne/blogs/CNETNewsBlog100.opml"&gt;http://weblogging.com/o/?http://news.com.com/html/ne/blogs/CNETNewsBlog100.opml&lt;/a&gt;
&lt;li&gt;Adam Curry's iPodder.org Directory&lt;br&gt;&lt;a href="http://weblogging.com/o/?http://homepage.mac.com/dailysourcecode/DSC/ipodderDirectory.opml"&gt;http://weblogging.com/o/?http://homepage.mac.com/dailysourcecode/DSC/ipodderDirectory.opml&lt;/a&gt;
&lt;li&gt;Channel 9 Videos (RSS Feed)&lt;br&gt;&lt;a href="http://weblogging.com/o/?http://channel9.msdn.com/rss.aspx?ForumID=14&amp;amp;Mode=0&amp;amp;sortby=0&amp;amp;sortorder=1"&gt;http://weblogging.com/o/?http://channel9.msdn.com/rss.aspx?ForumID=14&amp;amp;Mode=0&amp;amp;sortby=0&amp;amp;sortorder=1&lt;/a&gt; 
&lt;li&gt;Web 2.0 Workgroup &lt;br&gt;&lt;a href="http://weblogging.com/o/?http://web20workgroup.com/web20workgroup.xml"&gt;http://weblogging.com/o/?http://web20workgroup.com/web20workgroup.xml&lt;/a&gt;&lt;/ul&gt;
&lt;div&gt;Remember that this was developed in 2 hours so be gentle. I know there are quite a few bugs  (e.g., Many RDF files will not render and resources that redirect to a new location will not load - the latter issue appears to a problem with the xmlhttprequest object)&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;A challenge in building this demonstration (and where I spent a fair amount of the development) was writing code to determine the type of resource being requested. This is mostly due to the very ambigious OPML specification (see my &lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!2577.entry"&gt;previous post&lt;/a&gt;). To solve this, I do an extra round trip first requesting the headers. I then map the mime-type to one of the internal renderers. If you examine the code, you will notice it is designed to be extended with custom renderers for any type of XML resource (I took the cheapest approach by examining the root element and know this is not necessary the most semantically correct). While this extra roundtrip is unfortunate, since it is performed client-side, my server does not have to bare the cost of the requests - especially since many servers are extremely slow at returning HEAD requests.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Building these demonstration are quite fun. By eliminating the server component, I do not have to worry about scale or bandwidth constraints allowing me to focus on the scenario. I started with feed-oriented demos so that I can leverage the code to build even better mash-ups even faster in the future. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now, if there was only way to elminate that pesky cross-domain xmlhttp request issue...&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;UPDATE: If you visit the link and see gibberish, here is the error message that should have been displayed (I will investigate why the gibberish is occurring):&lt;/div&gt;
&lt;blockquote dir=ltr&gt;
&lt;div&gt;
&lt;p&gt;This page queries resources from multiple domains directly via Internet Explorer. You must configure your browser (currently IE only) to enable cross-domain access for this page.
&lt;p&gt;To change your Internet Explorer security options, select tools -&amp;gt; internet options. Click the security tab. Either add this domain (&lt;a href="http://weblogging.com/"&gt;http://weblogging.com&lt;/a&gt;) to your trusted site lists or under the Internet Zone, select custom level and change the &amp;quot;Access data sources across domains&amp;quot; to the &amp;quot;Prompt&amp;quot; value. (Note: We do not recommend enabling cross-domain data access for all sites in the Internet Zone). With the prompt setting, you will be prompted each time you try to search. 
&lt;p&gt;This page will not currently run in Firefox. Feel free to contact me if you have a solution to enable cross-domain access in Firefox.&lt;/div&gt;&lt;/blockquote&gt;
&lt;p dir=ltr&gt;UPDATE 2: If you still are seeing gibberish, try going directly to the page via &lt;a href="http://weblogging.com/o/o.htm"&gt;http://weblogging.com/o/o.htm&lt;/a&gt;.  I disabled http compression on my server and I believe that may have fixed the issue. If anyone has any other suggestions (I would like to reenable compression), please let me know.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+XMLHttpRequest+-+The+Ultimate+Outliner+(Almost)&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2776.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2776.entry</guid><pubDate>Wed, 26 Oct 2005 06:48:23 GMT</pubDate><slash:comments>67</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!2776/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2776.entry#comment</wfw:comment><dcterms:modified>2005-10-26T21:24:34Z</dcterms:modified></item><item><title>OPML - Please enlighten me</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2577.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;p&gt;I am not an Opml expert. This is the results of my observations of a couple Opml feeds. I fail to see how to adequately leverage Opml in the mash-up web world. 
&lt;p&gt;A few weeks ago, I published a demonstration for &lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!2332.entry" target="_blank"&gt;searching multiple site's &lt;/a&gt;entirely via the web-browser. I was illustrating the value of opening up unauthenticaed cross-domain xmlhttp requests and the opportunities that would create. 
&lt;p&gt;I planned to build a new demo that can &amp;quot;mash-up&amp;quot; Opml. This demo would take an XML feed (whether RSS, Atom, or Opml) and render it. For Opml lists, I wanted to expand each list item based on type. Opml files (e.g., reading lists) expansion would have been a powerful expression. Loading an Opml file would render the list. Each outline item would be rendered based on type within the page - links to other Opml lists would expand in outline format, links to Rss feeds would expand with the feed in place, links to Mp3 or videos would expand with a media player, html pages could expand with a preview of the page, and so on. This provides a foundation for a a very quick and effective newspaper page. 
&lt;p&gt;Developing this should have been trivial. The base code was less than a few screenfuls. However, my good intentions quickly fell apart because I discovered that Opml provides no (actually minimal) semantics to understand the items in the list without having to physically request them. 
&lt;p&gt;Opml apparently has a type attribute. However, this type attribute is not well defined. According to the &lt;a href="http://feeds.scripting.com/powerOpmlGuidelines" target="_blank"&gt;Opml Guidelines&lt;/a&gt;, this merely tells you that the link is an Rss feed or something else. Something else is pretty broad. Having to request the resource to somehow determine its type is a non-starter (I am not downloading a multi-megabyte video just to know its a video). Even worse, different feeds use the url and xmlurl fields differently. I found Opml files that list each type as a &amp;quot;link&amp;quot; and then the url refers to an Rss file.  Even in the most recent post dated a week ago, &lt;a href="http://www.opml.org/guidelinesForValidation" target="_blank"&gt;Validating OPML&lt;/a&gt;, while the type attribute is considered required, it still appears to distinguish only between Rss and the everything else. I can't understand why isn't type just the mime-type? 
&lt;p&gt;I know this has been a challenge for others as I found code attempting to determine types via the file extension on the Url. This approach is very unreliable especially with the dynamic nature of many sites (Many times every file, regardless of actually mime-type, will end in extensions such as .aspx, .php, etc.). 
&lt;p&gt;So... I guess I don't get it. A list is interesting but without knowing what is in the list I fail to see how I can adequately leverage and &amp;quot;mash&amp;quot; it up into a greater experience. 
&lt;p&gt;Please enlighten me.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+OPML+-+Please+enlighten+me&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2577.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2577.entry</guid><pubDate>Mon, 24 Oct 2005 18:20:46 GMT</pubDate><slash:comments>34</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!2577/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2577.entry#comment</wfw:comment><dcterms:modified>2005-10-24T21:33:49Z</dcterms:modified></item><item><title>We are Hiring!</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2374.entry</link><description>&lt;div&gt;Are you passionate about the web? Do you want to drive &amp;quot;Web 2.0&amp;quot; and have a big impact on the future of MSN?  Do you like to identify and solve big problems?  If so, I may have the job for you.  We are looking for Technical Program Managers, Senior Developers, and Testers to help drive the shared infrastructure and experiences across the MSN web properties.  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Below is one of the engineering openings (more should be posted soon).&lt;/div&gt;
&lt;blockquote dir=ltr style=""&gt;
&lt;div&gt;&lt;a href="http://members.microsoft.com/careers/search/details.aspx?JobID=fa10c675-656b-4702-a951-f296a93d676b"&gt;&lt;strong&gt;Job Title:&lt;/strong&gt; Software Development Engineer&lt;/a&gt;&lt;br&gt;&lt;strong&gt;Job Code: &lt;/strong&gt;142204&lt;/div&gt;
&lt;div&gt;Are you passionate about the Web client? Do you want to help establish and deliver the platform for enabling incredible online experiences across MSN? Do you want to influence the engineering direction across MSN?&lt;br&gt;&lt;br&gt;We are establishing a small team to focus on defining and implementing the browser-based architecture for MSN's next generation user experience. We need strong developers to define, implement, and communicate solid browser-based design patterns, architectures, and implementations for enabling interactive, fast, and consistent web experiences across MSN. &lt;br&gt;&lt;br&gt;A strong engineering background with hands-on experience building and shipping applications using ASP.net, C#, JavaScript/DHTML is essential. Experience with XSL, XML, CSS, API Design, and SOAP/ Web Services would be useful. You should also have a passion for solving client issues around accessibility, performance, web usability, security, presentation, and structural semantics. &lt;br&gt;&lt;br&gt;You will be applying all these skills to create and drive shared infrastructure and components. You will work closely with MSN properties as a key proponent and technical leader driving consistency in practice and implementation.&lt;/div&gt;&lt;/blockquote&gt;
&lt;div dir=ltr&gt;If you are interested, please send your resume to scott.isaacs[at]microsoft.com.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+We+are+Hiring!&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2374.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2374.entry</guid><pubDate>Sat, 15 Oct 2005 00:03:48 GMT</pubDate><slash:comments>22</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!2374/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2374.entry#comment</wfw:comment><dcterms:modified>2005-10-15T00:03:48Z</dcterms:modified></item><item><title>XMLHttpRequest - Eliminating the Middleman</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2332.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;div&gt;Inspired by Chris Pirillo's recently announced &lt;a href="http://gada.be/"&gt;http://gada.be&lt;/a&gt; search aggregation and continuing my previous discussion, &lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!2085.entry"&gt;XMLHttpRequest, Do you trust me?&lt;/a&gt;, I created a &lt;a href="http://weblogging.com/s"&gt;simple illustration demonstrating &lt;/a&gt;the value of unauthenticated cross-domain requests. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I recommend checking out &lt;a href="http://gada.be/"&gt;http://gada.be&lt;/a&gt; and &lt;a href="http://chris.pirillo.com/blog/_archives/2005/10/10/1291817.html"&gt;his blog &lt;/a&gt;to learn more about the vision behind the service.  Chris created a nifty &amp;quot;tag&amp;quot;-based search engine that can aggregate over 140 search engine results. It is also optimized for easy t9-based access from mobile devices.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;However, his site demonstrates the potential shortfalls of not being able to make cross-domain requests on capable clients. The performance of the site is dependent on his ability to query each individual service for each individual request through his server. The first day out, the gada.be service slowed as it was quickly picked up by the blogosphere. I do not know if every query is made live against each service but regardless, to maintain a performant popular service, gada.be most likely will need to build a server farm and deploy some level of intelligent caching to handle the remote requests. Perfecting such implementations add complexity and expense.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;While server-based aggregation will be necessary for some thin-devices (a key target for gada.be), if the more capable clients supported accessing services directly, the site could scale much better and have lower infrastructure costs.  This is a driving scenario around my thoughts to open up unauthenticated cross-domain xmlhttp access to public data.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;To illustrate, I created a client-based search aggregator page. This demonstration page and related files are 100% static with no code executing on the server. My server in this sample does not act as the intermediary to make requests. The implementation is less than 15K (unoptimized!) and it only took me about an hour to implement.  New search engines and categories can be added simply by extending an array.  Since every service is queried directly from your client, the server scales equally well for 1 service or a 100! This is an extremely efficient both in terms of execution costs and equally important, implementation complexities.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This approach cannot enter the mainstream today because user's must modify their security settings to use pages built this way. Before my search page will work you must customize your security settings using Internet Explorer.  Firefox is currently not supported mostly because I could not find sample code for requesting &amp;quot;cross-domain&amp;quot; permissions (if you know how, feel free to send me some sample code and I will update the page including fixing the firefox layout issues).  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Moving onto the demo... Visit &lt;a href="http://weblogging.com/s"&gt;&lt;strong&gt;http://weblogging.com/s&lt;/strong&gt;&lt;/a&gt;.  You can send queries via the URL as follows: &lt;a href="http://weblogging.com/s/?SearchText."&gt;&lt;strong&gt;http://weblogging.com/s/?SearchText&lt;/strong&gt;.&lt;/a&gt;  If your security settings are incorrect, you will get instructions on how to update them after making your first query. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This is intended to be a demonstration so I wouldn't be surprised if there are a few bugs or imperfections in the experience (remember, I developed this in under an hour). For example, I do not try to &amp;quot;correct&amp;quot; feeds with parsing errors.&lt;/div&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+XMLHttpRequest+-+Eliminating+the+Middleman&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2332.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2332.entry</guid><pubDate>Tue, 11 Oct 2005 14:55:08 GMT</pubDate><slash:comments>86</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!2332/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2332.entry#comment</wfw:comment><dcterms:modified>2005-10-11T16:01:55Z</dcterms:modified></item><item><title>XMLHttpRequest - Do you trust me?</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2085.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;p&gt;Many web applications that &amp;quot;mash-up&amp;quot; or integrate data from around the web hit the following issue: How do you request data from third party sites in a scalable and cost-effective way? Today, due to the cross-domain restrictions of xmlhttprequest, you must proxy all requests through a server in your domain. 
&lt;p&gt;Unfortunately, this implementation is very expensive. If you have 20 unique feeds across 10000 users, you are proxying 200,000 unique requests!  Refresh even a percentage of those feeds on a schedule and the overhead and costs really start adding up. While mega-services like MSN, Google, Yahoo, etc., may choose to absorb the costs, this level of scale could ruin many smaller developers.  Unfortunately, this is the only solution that works transparently (where user's don't have to install or modify settings).
&lt;p&gt;This problem arises because the xmlhttprequest object can only communicate back to the originating domain.  This restriction greatly limits the potential for building &amp;quot;mash-up&amp;quot; or rich aggregated experiences. While I understand the wisdom behind this restriction, I have begun questioning its value and am sharing some of my thoughts on this. 
&lt;p&gt;Let's compare xml to scripts. Scripts can be loaded from any server and run in the context of the requesting page. As more sites are building dynamic interfaces, they are also leveraging dynamically generated scripts. These scripts can return meta-data and other information based on the supplied querystring parameters. This is semantically the same as requesting an xml feed - the only difference being the serialization format. The ability to load third-party scripts is a fundamental building block for integration on the web (e.g., Google AdWords require them). Today, RSS and XML have also become a fundamental building block of the web. So why are we treating xmlhttp differently?
&lt;p&gt;Much of the cross-domain concern is around phishing attacks - xmlhttp can be used to request any file from another domain (e.g., html interface), While client access to this data can increase the attack vector, I do not believe the risk of this scenario outweighs the benefits.  I do not believe Phishing sites will benefit more from cross-domain access - they have been capable enough at stealing passwords by merely just copying the UI.  
&lt;p&gt;A related and misguided concern is cross-domain xmlhttp request is somehow aligned with XSS (cross-site scripting) exploits. The ability to request a resource from another domain is much different than the ability to execute script in the context of that domain. XSS is a completely different issue, and I am not proposing we remove those restrictions (although I do believe more work can be done to improve that area). 
&lt;p&gt;Other's claim that cross-domain xmlhttp requests can give the client access to private data. If the cross-domain requests are restricted to the same visibility as the host page (e.g., internet sites cannot access the intranet), then the information being requested is already public.  The only potential issue is with a rogue intranet site (requesting authenticated intranet data from another intranet site), but I believe that can be handled via greater controls. Prohibiting client-side cross-domain requests does not entirely protect the user. The moment a server is involved (which means any web-site), any such client internet request can be proxied by the server.  Furthermore, there is no way to indicate to the user when the server does the proxying.
&lt;p&gt;As a believer in integrated experiences and examining the key scenarios driving the web forward, I would prefer to see xmlhttprequest reenabled by default. We should reconsider supporting cross-domain requests within the same zone or at minimum limiting such data requests to the internet. If we want to focus on enabling basic aggregator-type experiences, further scope this to supporting just http &amp;quot;get&amp;quot; requests (no secure https or &amp;quot;post&amp;quot;ing). Let's stop treating third-party xml any different from a third-party scripts, stylesheets, or images, which can all be requested without restriction. They are all &amp;quot;embeddable&amp;quot; resources.  
&lt;p&gt;Getting back to the title of this post, Do you trust me?  I believe disabling cross-domain xmlhttprequest actually has little relevance to answering this question especially since the server can already proxy these requests.  Since the web is an inherently &amp;quot;unmoderated&amp;quot; environment, we need to focus on improving security through better communication. IE7 announced they are investing heavily in &lt;a href="http://blogs.msdn.com/ie/archive/2005/09/09/463204.aspx"&gt;anti-phishing features &lt;/a&gt;that will highlight suspect web-sites. That coupled with proper user notifications are the critical features that I believe help answer the trust question. For example, any site that requests a script, xml, or other resource file from another domain should have a special indicator (e.g., similar to the privacy indicator).  I would even argue that any site making any xmlhttp or other background requests to their own server get a slightly different indicator. User's (and other hueristics) can examine the data requested and choose to prevent the page from executing (and obviously, users should have settings to modify the defaults).  
&lt;p&gt;Sometimes we should consider reevaluating prior decisions - even if they were made in the name of tighter security. I am interested in hearing other developers and users views on this.  Am I misguided in my view that xml should be treated no different than other embeddable resources?  Or is requesting xml data inherently different than scripts and is something that should be protected?
&lt;p&gt;Also, I just want to be clear before anyone gets overly excited (especially those that may disagree with me), there are no plans that I know of to change browser security models around xmlhttprequest. These are merely my obversations.&lt;/div&gt;
&lt;p style="font-size:1px;color:white;line-height:0px"&gt;Technorati Tags: &lt;a style="color:white" href="http://technorati.com/tag/xmlhttprequest" rel=tag&gt;xmlhttprequest&lt;/a&gt; | &lt;a style="color:white" href="http://technorati.com/tag/ajax" rel=tag&gt;ajax&lt;/a&gt; | &lt;a style="color:white" href="http://technorati.com/tag/web+2.0" rel=tag&gt;web 2.0&lt;/a&gt; | &lt;a style="color:white" href="http://technorati.com/tag/javascript" rel=tag&gt;javascript&lt;/a&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+XMLHttpRequest+-+Do+you+trust+me%3f&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2085.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2085.entry</guid><pubDate>Thu, 29 Sep 2005 03:13:32 GMT</pubDate><slash:comments>147</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!2085/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2085.entry#comment</wfw:comment><dcterms:modified>2005-09-29T05:19:13Z</dcterms:modified></item><item><title>Talking about MSN DHTML Foundation unveiled</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2045.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;p&gt;My Scoble video was posted (and I am listed on one of his &lt;a href="http://channel9.msdn.com/Showpost.aspx?postid=118332"&gt;favorites&lt;/a&gt;).  This was recorded before the PDC so my demo's of Start.com are already slightly dated :-)  [btw - see &lt;a href="http://www.start.com/pdc"&gt;http://www.start.com/pdc&lt;/a&gt; instead of the root page to try out Gadgets, etc] 
&lt;p&gt;Scoble holding a hand-held video camera in your face is a very interesting experience :-) 
&lt;p&gt;&lt;em&gt;Quote&lt;/em&gt; 
&lt;blockquote&gt;&lt;a href="http://channel9.msdn.com/showpost.aspx?postid=118319"&gt;Scott Isaacs - MSN DHTML Foundation unveiled&lt;/a&gt;&lt;br&gt;Scott Isaacs is one of the inventors of DHTML. He is one of Microsoft's smartest Web developers and built a framework that's being used on Start.com, the future Hotmail, and other places like the new gadgets in Windows Vista. Hope you enjoy meeting Scott, sorry for the bad lighting at the beginning. If you've done any AJAX development, you'll find this one interesting and you'll get a look at some bleeding-edge Web development that MSN is doing.&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Talking+about+MSN+DHTML+Foundation+unveiled&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2045.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2045.entry</guid><pubDate>Wed, 21 Sep 2005 03:15:53 GMT</pubDate><slash:comments>42</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!2045/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!2045.entry#comment</wfw:comment><dcterms:modified>2005-09-29T05:33:21Z</dcterms:modified></item><item><title>Modernizing Javascript: Namespaces and Style</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1921.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;div&gt;In my last &lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!1919.entry"&gt;Modernizing Javascript&lt;/a&gt; article, I introduced how we use namespacing to encapsulate reusable functionality.However, since most of our javascript classes are tightly coupled to the user-interface, how do you also associated the scripts with the appropriate layout.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;For example, in MSN Spaces we have the rich text editor (RTE). This RTE is built as a reusable component (e.g., Hotmail is going to use the same editor).  The RTE also has a fair amount of complex layout rules. We need to guarantee that any RTE layout does not interact outside the scope of the RTE component. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Traditionally, developers would encapsulate the layout within the scripts. Unfortunately, this approach prescribes a specific look and feel and violates the principals of separating structure, behavior, and presentation. Therefore, the RTE instead defines all its layout and default presentation via CSS. Doing so enables consumers of the component to easily override presentation without having to touch the core code. However, this also requires us to define CSS rules that will not interact with the rest of the page. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;CSS has a built-in approach to scoping a style sheet via the CSS selector. We prescribe a pattern that provides uniqueness for defining and applying classes to elements.  Looking back at my previous post on namespaces, you will notice that we have a pattern for encapsulating functionality within a namespace. We reuse this exact same pattern to define classes on elements.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;For example, we have a Rich Text Editor that may be implemented in the following namespace:&lt;/div&gt;&lt;pre&gt;Web.UI.Editor = function()
{
  // Implementation of the RTE
}&lt;br&gt;// Establish inheritance (from the framework)&lt;br&gt;Web.UI.Editor.registerClass(&amp;quot;Web.UI.Editor&amp;quot;,&amp;quot;Web.Bindings.Base&amp;quot;);&lt;/pre&gt;
&lt;div&gt;Since we are assuming the namespace and Javascript class are unique, we reuse the same JavaScript class as the class of any structural elements associated with the RTE.&lt;/div&gt;&lt;pre&gt;&amp;lt;div class=&amp;quot;Web_UI_Editor Web_Base_Bindings&amp;quot;&amp;gt;&lt;br&gt;  ...RTE structure...&lt;br&gt;&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;To maintian proper CSS class names, all &amp;quot;.&amp;quot; in the namespace hierarchy are replaced with &amp;quot;_&amp;quot;.  The above div element is a structural element used by the Web.UI.Editor class. Now, to define CSS scoped to the RTE structural elements, we define our rules as follows:&lt;pre&gt;.Web_UI_Editor {background: lightgrey}&lt;br&gt;/* All editor paragraphs have no margin */
&lt;br&gt;.Web_UI_Editor P {margin:0px} &lt;/pre&gt;
&lt;div&gt;On the div, we presented two classes. That is a lead into a future article, inheritance. Our RTE inherits from a base class, Web.Base.Bindings. We associate the entire inheritance chain with the element class. This way, when you inherit, you also automatically inherit and base styles.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;As you can see, it is important when building you components to take a complete view - not only of your code but your associated styles. By applying a few simple patterns, you can more easily engineer and reuse components.&lt;/div&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Modernizing+Javascript%3a+Namespaces+and+Style&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1921.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1921.entry</guid><pubDate>Sat, 10 Sep 2005 16:53:35 GMT</pubDate><slash:comments>5</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1921/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1921.entry#comment</wfw:comment><dcterms:modified>2005-09-10T17:08:21Z</dcterms:modified></item><item><title>Modernizing Javascript: Namespaces</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1919.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;p&gt;As we head into the PDC next week, I am going to introduce some of our techniques for using JavaScript to modernize the Javascript language. I am going to start with a simple concept, simulating namespaces. 
&lt;p&gt;Most web-development is very ad-hoc. Global variables and functions are often sprinkled throughout the web-page. In MSN, we are building resuable components. To allow independent teams and developers to leverage and reuse code, we needed a pattern that encapsulates logic to avoid variable and function collisions. Back in March (links provided at the end), I briefly introduced using closures and demonstrated how to create Singletons to encapsulate private variables. 
&lt;p&gt;Now I am going to take that a step further. In JavaScript it is possible to simulate namespaces by creating object structures. Namespaces are a common pattern in most OO languages that allow you to encapsulate classes, structures, etc. In JavaScript, we create a namespace as follows: &lt;pre&gt;var Demo = {} // Create the Demo Namespace
Demo.Dialogs = {} // Create a Dialogs namespace
&lt;/pre&gt;
&lt;p&gt;Now, you can add classes and functions to the different namespaces (e.g., Demo and Demo.Dialogs): &lt;pre&gt;Demo.Application = new function()
{&lt;br&gt;  // Singleton Application instantiated while parsed
}

Demo.Dialogs.colorPicker = function()
{
}
&lt;/pre&gt;
&lt;p&gt;We simplify the namespace creation with a simple registration function, &lt;code&gt;registerNamespace(&amp;quot;&lt;em&gt;namespace&lt;/em&gt;&amp;quot;)&lt;/code&gt;. We call this function to register each namespace.  
&lt;p&gt;This function generates each component of the namespace as required (e.g., registerNamespace(&amp;quot;Demo.Dialogs&amp;quot;) will create Demo if necessary, then Dialogs if necessary). Creating the namespace only as required is critical. If you create a namespace, e.g., Demo.Dialogs, and then later in another script someone extends the same Demo namespace by manually creating the namespace, all prior functionality will be destroyed (you are basically reinitializing the Demo object). 
&lt;p&gt;Within MSN, we designate a namespace for framework infrastructure and generic utility functionality, and each property develops their code in their own respective namespace. This allows us to leverage indepedently developed code without worrying about namespace collisions. 
&lt;p&gt;A little closing thoughts:&lt;br&gt;This simple technique illustrates how to leverage namespaces in your script. Script is only one aspect of a component. Most components also consist of Style and Structure. How do you leverage and apply the CSS Layout to apply only to the structure associated with your component? I will leave my answer to a future post. 
&lt;p&gt;My earlier blog entries on Closures: 
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!359.entry" target="_blank"&gt;JavaScript singleton objects (and how to avoid polluting the global namespace)&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!340.entry" target="_blank"&gt;What makes closures interesting?&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!338.entry" target="_blank"&gt;Closures and IE Circular References&lt;/a&gt;&lt;/ul&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Modernizing+Javascript%3a+Namespaces&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1919.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1919.entry</guid><pubDate>Fri, 09 Sep 2005 14:56:40 GMT</pubDate><slash:comments>17</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1919/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1919.entry#comment</wfw:comment><dcterms:modified>2005-09-09T14:58:48Z</dcterms:modified></item><item><title>Rethinking Web Development - Event Handlers</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1837.entry</link><description>&lt;div style="font-size:115%;line-height:1.5"&gt;
&lt;p&gt;As I discuss platforms or frameworks in the browser, I continue to emphasize on the value of putting &amp;quot;engineering&amp;quot; principals into the client. One of the biggest issues with much web development is typically the lack any development methodologies.  This combined with the flexibility of scripting and DHTML often leads to poorly constructed code.
&lt;p&gt;Let's take a quick look at event handlers. When I wrote the DHTML event specification back in 1997, I focused heavily on embracing and extending the simplistic Netscape 3.0 event model. Netscape prescribed that all events were also attributes on the respective elements.  With DHTML, we extended this model with many more events and by adding them to every element. To support these new events and meet the 100% backwards compatibility reuqirement at the time, I introduced the concept of automatic bubbling model. Event bubbling not only enabled our compatibility requirements but also provided a very simple but powerful early solution to simulate subclassing of an element's behavior (you could grab an event on the document and override behavior globally). Netscape's original few events focused mostly on enabling control over default behaviors. In DHTML, we had lots of rich rich information with each event (mouse, keyboard, event source, etc). To faciliate this extra information, I created the window.event object. The creation of the event object on the window was an outgrowth of our compatibility requirements. We needed a way to pass rich information to event handlers without modifying (at that time) the signature of the event call. While the event object as a window property is less than ideal (it relied on the single-threaded nature of the browser's script engine), the overall eventing model provided the foundation for enabling very interactive sites.
&lt;p&gt;Quickly after IE4 was released, it was recognized that the singular focus of an event handler was a big shortcoming. By only having the ability to assign a function to a handler, it was hard to have multiple listeners to any single event. This issue becomes more prevalent if you planned to write modular, reusable code (how do three independently written functions sync the document onclick event). In the early days, this was solved by building simple event broadcast libraries (or the first &amp;quot;frameworks&amp;quot;). In Internet Explorer 5, this scenario was codified into the attachEvent and detachEvent methods and later standardized as addEventListener and detachEventListener (supported by Firefox and other browsers).
&lt;p&gt;So... Why this walk through history?  Today, many developers still focus on using the original function assignments for defining event handlers. As you consider engineering your web application, start thinking about how your code may react when dropped into different pages. The ability to properly modularize your code is critical as you consider building reusable code on most frameworks. Unless the element you are referencing is truly private (e.g, creating in the context of your code), assigning directly to an element's event property is asking for trouble. Instead, explore the attach/detachEvent and add/removeEventListener methods for all your event listening needs.
&lt;p&gt;Defining event handlers within the HTML as an attribute of the element is equally if not more harmful to reusability and maintainability of your site. While in-line event handlers are convenient, they start comingling your structure and behavior. Just like the old web mantra to separate structure from presentation, you should consider how to separate the behavior from the structure from the presentation. 
&lt;p&gt;This brief introduction leads into a broader topic that I am going to try and discuss over the next few weeks - how do you properly separate structure, presentation, and behavior to build reusable components. 
&lt;p&gt;I will close with the following tip:&lt;br&gt;The href attribute on the anchor element supports script (e.g, &amp;lt;a href=&amp;quot;javascript:void(doSomething())&amp;gt;). Many developers use this like an event handler.  Unfortunately, the scripted href has side-effects in the IE DHTML event model.  Even though the href is script, since the physical onclick event has not been cancelled, this is considered a true navigation. This causes the IE onbeforeunload event to fire even though the page is most likely not physically unloading. This can lead to unexpected side-effects in applications that use this event. Therefore, do not put scripts on this attribute. Instead, use the proper onclick event.&lt;br&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Rethinking+Web+Development+-+Event+Handlers&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1837.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1837.entry</guid><pubDate>Mon, 29 Aug 2005 06:11:28 GMT</pubDate><slash:comments>36</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1837/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1837.entry#comment</wfw:comment><dcterms:modified>2005-08-29T16:04:20Z</dcterms:modified></item><item><title>When bugs become patterns - A look at CSS Hacks</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1805.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;p&gt;When asked about developing web applications, I used to joke that it is a black art, mixed with a little bit of illogical reasoning, and brought together under completely unsound engineering principals. Unfortunately, this describes the state of many cross-browser CSS work-arounds.
&lt;p&gt;It is well known that each browser has its own slightly unique way of interpreting CSS. These differences create headaches for web-developers. We have all learned how to manipulate the various box models by introducing extra structure into the page. While adding structure can smooth out some of the box-model differences, I never understood how any engineer could then decide to apply their knowledge of bugs and incomplete implementations to create and apply the styles to their page.
&lt;p&gt;Below I am going to list a few hacks I found after a very quick search of the web (there are hundreds of documents on the subject). These are mostly to illustrate some of the &amp;quot;state of the art&amp;quot; of cross-browser CSS:
&lt;p&gt;from &lt;a href="http://www.albin.net/CSS/beMeanToOpera.html" target="_blank"&gt;The “Be Mean to Opera” Hack&lt;/a&gt;&lt;br&gt;&lt;code&gt;html&amp;gt;body div.myDiv { color: red;&lt;br&gt;c\olor: black;&lt;br&gt;/* be ~mean~ to Opera -- http://www.albin.net/CSS/beMeanToOpera.html */ } &lt;/code&gt;
&lt;p&gt;from &lt;a href="http://www.tantek.com/CSS/Examples/boxmodelhack.html" target="_blank"&gt;Tantek's famous box model hacks&lt;/a&gt;&lt;br&gt;&lt;code&gt;div.content { width:400px;&lt;br&gt;voice-family: &amp;quot;\&amp;quot;}\&amp;quot;&amp;quot;;&lt;br&gt;voice-family:inherit;&lt;br&gt;width:300px; } &lt;/code&gt;
&lt;p&gt;My favorite hacking mistakes are those that try to leverage unsupported &amp;quot;real&amp;quot; features: &lt;br&gt;&lt;code&gt;html&amp;gt;body #header {margin-bottom:1em}&lt;/code&gt; 
&lt;p&gt;The above examples have actually become part of the CSS development &amp;quot;patterns&amp;quot; - and more amazingly, there are many more. While these solutions are very creative, I refuse to explain what they do or why they may be used for a simple reason - they promote the black art of the web instead of pushing sound engineering. I have seen stylesheets mix so many different hacks, all without comments, making it impossible to decypher the intended presentation, and even more impossible to debug. Furthermore, as new browsers are released, how do you know the parsing bug or feature you are relying on will not be removed or modified. 
&lt;p&gt;Now, I wouldn't be bringing this up if there wasn't a very simple and logical solution to this issue. Let's start by thinking about the problem. In a perfect world, we would create a single CSS stylesheet that would work everywhere. Unfortunately, the browser world is probably about 95% perfect (which I determined in a completely arbitrary and unscientific way) leaving us to find a way to deal with the difference. 
&lt;p&gt;So... assuming the world of CSS is &lt;em&gt;almost&lt;/em&gt; perfect, we focus on building a single style sheet and explicitly &lt;em&gt;targeting&lt;/em&gt;  any such imperfections. How do we accomplish this? CSS has a built-in mechanism called the class name. Differing class names can be used to generate completely different layouts. We can leverage this approach for browser targeting. 
&lt;p&gt;I focus on applying a classification scheme onto the &amp;lt;HTML&amp;gt; element either dynamically generated on the server side or injected into the element via client script. This classification can be used generate CSS overrides. Confused? Let me give you a few examples:&lt;pre&gt;&amp;lt;html class=&amp;quot;firefox m1 d03 mac&amp;quot;&amp;gt;
&amp;lt;html class=&amp;quot;ie m6 d0 win&amp;quot;&amp;gt;
&amp;lt;html class=&amp;quot;opera m8 d0 win&amp;quot;&amp;gt;
&lt;/pre&gt;
&lt;p&gt;If you haven't figured it out, I specify the browser type, the major version, the minor version, and the platform. This classification scheme can be as simple or as complex as you wish. Now... in my css sheet, let's look a simple few rules: &lt;pre&gt;div.Box {margin:5px;width:100px;padding:5px}
html.firefox div.Box {width:95px}
html.opera.m8 div.Box {padding:0px}&lt;/pre&gt;
&lt;p&gt;Can you guess what the above does? The div element with the class &amp;quot;Box&amp;quot; gets a default width of 100 pixels. For FireFox and Opera V8 we created two targeted overrides: In Firefox, the width is set to 95px. In opera, major version 8, the same element has no padding (and is 100 pixels wide). 
&lt;p&gt;Why do I like this approach? Anyone familiar with CSS can walk up to the stylesheet and quickly decypher the intent of the stylesheet and the specific browser issues being addressed. No bugs or missing features being leveraged, just good old solid understanding of the CSS model being applied in a reasonable, logical, and sound way. 
&lt;p&gt;UPDATE: I have seen a few comments (from other blogs) concerned about &amp;quot;coding&amp;quot; in specific versions. This was for illustrative purposes. Typically, you only need generalized overides (e.g., html.opera) with version specific overrides that may exist for legacy versions. This way we are reasonably protected when a new browser is released. If the new browser fixes the issue, we then increase the specificity to use the version.  
&lt;p&gt;Also, for caching - these are psuedo-dynamic pages and depending on your architecture can serve these cached once you determine the user-agent. The biggest issue occurs if your page is truly static and is intended to be cache by proxies.  In this scenario, a server generated approach is not the way to go. For this reason, and since I do not like to burden the server with processing the client can easily handle, I typically use client-based solutions whenever possible. For my scenarios, I am less concerned about users that disable scripting - we are building applications, not web pages - and I view the argument that our applications should be able to run with scripting turned off as academic. I will save a deeper explanation for another post and how to handle the no-scripting case. 
&lt;p&gt;Also, this approach only needs to recognize browsers of interest and align them to your desired classifications scheme which may be different from using version, etc.  If the browser is not recognized, it will get render with &amp;quot;standard&amp;quot; stylesheet, which is a reasonable and perhaps the only possible result.
&lt;p&gt;As my closing nugget: &lt;br&gt;CSS is an extremely powerful system that can greatly reduce your need for script. By simply changing the class name on an element, you can completely impact the entire layout of the document (hiding content, showing other content, repositioning, etc). Think about how you can apply this technique to replace widespread &amp;quot;presentation&amp;quot;-driven scripts with a single line that swaps the class name of an html element.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+When+bugs+become+patterns+-+A+look+at+CSS+Hacks&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1805.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1805.entry</guid><pubDate>Wed, 24 Aug 2005 05:50:06 GMT</pubDate><slash:comments>57</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1805/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1805.entry#comment</wfw:comment><dcterms:modified>2005-08-29T14:18:22Z</dcterms:modified></item><item><title>Why Ajax is so 1999? Part 2</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1713.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;p&gt;Over the next few weeks, I am exploring how the AJAX pattern by itself is inadequate for building truly next-generation web-sites.  I suggest starting with my &lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!1685.entry"&gt;opening post&lt;/a&gt; on this subject...
&lt;p&gt;One of my favorite topics for building rich interactive sites is how to manage the network pipe.  This is essential if you want to build a truly winning experience. Let's start by reviewing how the browser manages individual pages.  Today, when you visit a web page, the page processes external sources and starts to deploy them. If you leave the page, all outstanding requests are aborted. This frees up resources and bandwidth for the incoming page. This pattern should be duplicated within your “AJAX” site. 
&lt;p&gt; 
&lt;p&gt;Let's apply this to two different scenarios:&lt;br&gt;You have an “AJAX” application managing two tabs (within one web-page). The first tab is displaying a Blog, and another tab is displaying Photos.  Each view requires its own unique set of asynchronously requested data to display.  If you were building a traditional web-site, each tab would be a unique web page.  Therefore switching tabs would work efficiently with the network as the browser would abort any incomplete “data” requests from the first page before continuing onto the next page. If you fail to duplicate this pattern on your “AJAX”-enabled page, you can easily end up with a very poor experience. Imagine the photo tab was in the process of downloading multiple very large images when the user switches back to the blog view.  If you do not proactively manage the download process, those images are going to temporarily block and prevent the blog view from retrieving its data. 
&lt;p&gt;In the first example, we described two distinct views.  However, it is actually not the view you need to examine, but it is the entire application context. Let’s examine an AJAX e-mail client that supports in-line previewing of messages. As the user is navigating down the list of mail messages, you start requesting the full e-mail message. If you just fire your requests sequentially, you might quickly clog the available connections potentially bringing your application to a halt. Instead, you should be aborting the existing requests as the user changes their “context” freeing the connection to provide an optimal experience.
&lt;p&gt;You can’t assume broadband will solve this issue for you. You need to remember current standards define that browsers should only open two simultaneous connections at a time to any single server. Therefore, if you queue many large requests, even with today’s broadband, you could get significant delays.
&lt;p&gt;This leads to my second pattern - very rich web sites should efficiently manager their network requests against the current context of the application.
&lt;p&gt;And guess what, I am not yet done with network management.  There is at least one more issue I plan to discuss on making AJAX requests scale.  Stay tuned.
&lt;p&gt; 
&lt;p&gt;Two closing user-experience related nuggets to think about:
&lt;p&gt;In the above example, I referred to data requests. If your requests are updating, creating, or deleting data, the pattern just got a lot more complicated. In these scenarios, you do not want to abort the request. However, you must also take into consideration the user-experience if the user changes views and an out of context operation fails – how do you notify the user, what is the expected recovery?  Even more complicated is how to maintain integrity of these requests if the user leaves your page before the operation completes.  
&lt;p&gt;The switching of views also illustrates one of the biggest experience challenges of an &amp;quot;AJAX&amp;quot;-patterned site. In a traditional page-based web-site, switching views loads a new web-page. Having distinct pages enables the browser's history experience and provides distinct URL's that can be e-mailed or added to your favorites. In web applications, these paradigms are usually completely lost or broken. This loss is avoidable (but the implementation can get complicated). 
&lt;p&gt;As I continue, I am probably not going to address all my little nuggets. They are there to present (mostly an incomplete list of) related issues that should considered when creating rich web-based applications.&lt;br&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Why+Ajax+is+so+1999%3f+Part+2&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1713.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1713.entry</guid><pubDate>Mon, 15 Aug 2005 18:50:48 GMT</pubDate><slash:comments>74</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1713/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1713.entry#comment</wfw:comment><dcterms:modified>2005-08-29T14:26:50Z</dcterms:modified></item><item><title>Why Ajax is so 1999? Part 1</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1685.entry</link><description>&lt;div style="font-size:115%"&gt;
&lt;div&gt;Before I jump right in, I want to quickly pre-announce that we are working on two exciting lunch-time talks at the &lt;a href="http://msdn.microsoft.com/events/pdc/"&gt;Microsoft PDC&lt;/a&gt; about how MSN is building itself.  I will be posting more details about these sessions in the coming weeks. Since the &lt;a href="http://msdn.microsoft.com/events/pdc/"&gt;PDC &lt;/a&gt;is a developer's conference, I am going to write a series of blog posts about web development patterns in MSN as we lead up to the big event. We are going to apply many of these patterns and more during our talks at the PDC.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;Now...  I know I have said this before - Ajax is nothing new.  I am going to state it even more strongly this time - Ajax is a marketing term for a programming pattern around &amp;quot;ancient&amp;quot; (in web-speak) technology. It is not an implementation or even a best practice.  I am not sure if a development pattern has even been marketed so well and picked up so broadly outside the development community :-) Interestingly, everything and the kitchen sink is now falling under the &amp;quot;Ajax&amp;quot; moniker. Now, in reality, the best implementations of technology is when the customer does not see or feel the technology. What we build should feel natural - the patterns used, whether &amp;quot;AJAX&amp;quot; another, really should have no relevance to the customer. However, I digress, so getting back to the AJAX pattern....&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The AJAX pattern is a fairly logical and obvious one.  Rather than refresh entire pages, you expose interfaces on your server that allow you from within a web-page to post and then process xml responses. Some people have proclaimed that the Ajax pattern is bringing in the next generation web. By itself, Ajax is nowhere close to what I would call &amp;quot;next-generation&amp;quot;.  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I am going to explain why over a series of posts. Each post is going to introduce additional challenges we are addressing that are driving the creation of additional patterns. We are using these patterns across MSN. These patterns are much more interesting, optimal implementations are much more challenging, and the aggregate of AJAX combined with these patterns will better exemplify the broad range of possibilities and opportunities in web-development. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Most current &amp;quot;Ajax&amp;quot; patterned sites are what I consider first-generation or 1.5 generation &amp;quot;DHTML&amp;quot; sites.  These sites are almost all what I call a &amp;quot;closed&amp;quot; application. These are applications where all the logic is defined and downloaded up-front. Now let's compare that to what I call an &amp;quot;open&amp;quot; or loosely coupled application. These are applications without known or predefined boundaries.  For example, let's look at &lt;a href="http://www.start.com/3"&gt;Start.com&lt;/a&gt;. &lt;a href="http://www.start.com/3"&gt;Start.com&lt;/a&gt; starts as a closed application - it is an RSS aggregator. However, as you interact with the application it dynamically morphs. New components are downloaded and deployed on demand based on different stimuli.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This is the first step to building the truly next generation web-site.  Over time, imagine having hundreds or even thousands of components, each with their own logic, that in any combination or permutation define the &amp;quot;application&amp;quot;. Ignoring how you would build these component (that will come later), how does such an application deploy? You would not want to deploy every aspect of the application. This is especially so when you consider most of the time only a small set of components or features are initially required.  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;In Start.com, the system not only applies the &amp;quot;Ajax&amp;quot; patterns to requesting and loading data, but there is an underlying system that knows how to deploy resources (code and style sheets) on demand.  When you add a &amp;quot;Startlet&amp;quot; to your page, the necessary resources are automatically downloaded, attached to the application, and instantiated.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This brings me to my first pattern- very rich web applications require a dynamic system to efficiently deploy resources. This also highlights an entire class of issues just around resource management - how do you efficiently manage and prioritize resource deployment?, how do you proactively control the network pipe to more efficiently manage your application?, etc. Network pipe management is one of my favorite topics and one of the best examples of where the AJAX pattern by itself is completely inadequate (stay tuned)&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I will start addressing those and many more issues in the coming weeks. In the meantime, I leave you with one more nugget to think about:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;One of the most expensive resources for a browser to download is script. Typically, the client opens two connections per domain for requesting content. However, if you analyze the load patterns of any web-page, you will almost always notice that when a script loads, itis the only resource being processed (scripts are typically loaded serially) - additional downloads do not continue until after the script loads. The serialization of script downloads can easily cost you an additional 10%-15% of time to download the page. This loss is avoidable and is something to think about. &lt;/div&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Why+Ajax+is+so+1999%3f+Part+1&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1685.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1685.entry</guid><pubDate>Fri, 12 Aug 2005 05:22:51 GMT</pubDate><slash:comments>43</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1685/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1685.entry#comment</wfw:comment><dcterms:modified>2005-08-29T14:29:15Z</dcterms:modified></item><item><title>MSN Frameworks and the new Start.com MSN Blog Map</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1479.entry</link><description>&lt;div&gt;From my previous few discussions on MSN and Frameworks, you may have guessed that we have a client framework infrastructure.  We are developing a framework to enable us to consistantly implement and integrate rich components.  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;To demonstrate how the MSN Frameworks will enable us to innovate quickly - I built and shipped (beta quality :-) a new MSN Blog Map component within start.com.  The MSN Blog Map maps bloggers from throughout MSN (expect the list to grow over the next few weeks). You can check it out at &lt;a href="http://www.start.com/3"&gt;http://www.start.com/3&lt;/a&gt;.  After the page loads, add MSN Blog Map from Staff Favorites in the left column. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This component leverages &lt;a href="http://virtualearth.msn.com/"&gt;MSN Virtual Earth&lt;/a&gt; to create a new component that integrates with &lt;a href="http://www.start.com/3"&gt;Start.com&lt;/a&gt;.   Having our client framework enables quick experimentation, implementation, and ship of integrated scenarios. For the MSN Blog Map, I added custom logic on top of the Virtual Earth rendering component and integrated with the existing RSS rendering objects of start.com.  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Having a strong framework for building and integrating rich, highly interactive components enables MSN to deliver much better (and consistent) user experiences. The Framework provides us with a client-side component model, network stacks, firefox compatibility, and OO  language enhancements that allows us to &amp;quot;engineer&amp;quot; rather than ad-hoc script the client. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Many of our goals and work is going to be captured in the &lt;a href="http://weblogs.asp.net/scottgu/archive/2005/06/28/416185.aspx"&gt;Microsoft Atlas&lt;/a&gt; effort. Microsoft Atlas, from the ASP.net team, is an upcoming toolset to quickly enable any web-developer to create and build highly-interactive web-sites.  &lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+MSN+Frameworks+and+the+new+Start.com+MSN+Blog+Map&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1479.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1479.entry</guid><pubDate>Thu, 28 Jul 2005 02:44:12 GMT</pubDate><slash:comments>113</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1479/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1479.entry#comment</wfw:comment><dcterms:modified>2005-07-28T02:47:53Z</dcterms:modified></item><item><title>Frameworks, IE and XMLHttp</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1172.entry</link><description>&lt;div&gt;So far, I pointed out how we are using our framework to enable compatibility between IE and Firefox. The compatibility layer goes both ways. Firefox has native support for the xml http request object directly off the window object. In IE, this same object is exposed via an ActiveX control.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;To resolve these differences, we extend the DOM in IE to establish the standard Firefox compatible way to create the xmlhttp request object.  Below is a simple code fragment that should run only in IE:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff"&gt;if (!window.XMLHttpRequest) {&lt;br&gt; window.XMLHttpRequest = function()&lt;br&gt; {&lt;br&gt;  var xmlHttp = null;&lt;br&gt;  var ex;&lt;br&gt;  try { xmlHttp = new ActiveXObject(&amp;quot;Msxml2.XMLHTTP.4.0&amp;quot;);} catch (ex) &lt;br&gt;  {&lt;br&gt;    try { xmlHttp = new ActiveXObject(&amp;quot;MSXML2.XMLHTTP&amp;quot;);} catch (ex)&lt;br&gt;    {&lt;br&gt;      try { xmlHttp = new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;);} catch (ex){}&lt;br&gt;    }&lt;br&gt;  }&lt;br&gt;  return xmlHttp;&lt;br&gt; }&lt;br&gt;}&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font face="Courier New" color="#0000ff" size=2&gt;&lt;/font&gt;&lt;br&gt;Now, whereever we need to use the xmlhttp request object, we merely have to call:&lt;/div&gt;
&lt;div&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff"&gt;var newRequest = new XMLHttpRequest();&lt;/font&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This again demonstrates how a framework enables us to develop pages without the typical browser detection.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;We also take this approach to extend the basic support of the document DOM.  We have found that access to the document's HTML and HEAD element is often very useful.  Today the DOM has a body property for accessing the object representing the BODY element.  A natural extension would be to add a html and head property.  We extend the document via the framework with the following two simple statements:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;font face="Courier New, Courier, Monospace"&gt;&lt;font color="#0000ff"&gt;document.html = document.getElementsByTagName(&amp;quot;HTML&amp;quot;)[0];&lt;br&gt;document.head = document.getElementsByTagName(&amp;quot;HEAD&amp;quot;)[0];&lt;/font&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;Now we can use those properties as if they were native to the DOM.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now combine these with standard patterns (e.g., class definitions via closures) and you start to see how we can greatly simplify our approach to web programming.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;UPDATE: Better structured the XMLHttpRequest function.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Frameworks%2c+IE+and+XMLHttp&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1172.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1172.entry</guid><pubDate>Fri, 01 Jul 2005 20:42:28 GMT</pubDate><slash:comments>94</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1172/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1172.entry#comment</wfw:comment><dcterms:modified>2005-07-04T00:36:48Z</dcterms:modified></item><item><title>Frameworks, Firefox and the right click button</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1109.entry</link><description>&lt;div&gt;The MSN.com Firefox issue (see my blog entry below) is a good example of how frameworks help improve building and debugging your web-site.  The traditional client programming approach is to one-off fixes for browser issues with lots of if-then statements. Unfortunately this does not scale well.  How do you know that all developers are applying the fixin a consistent way?  How do you even test for this? Another traditional pattern is you require all developers to use helper functions.  But how do I know developers are actually using those functions? As the browser APIs get richer, rather than create helper functions that basically define a new API, we whenever possible try to fix this in the context of the existing API.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So how can we do this with our compatibility framework?&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Let's look at Firefox and the right click menu. Firefox (in 1.0.4) is currently firing the onclick event on the document for the right mouse button. Below is a very simple firefox repro script that should prevent hyperlinks from being followed (this will not run in IE) but has the unintended side effect of also blocking the right click menu:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff" size=2&gt;&amp;lt;script&amp;gt;&lt;br&gt;function doThis(ev)&lt;br&gt;{&lt;/font&gt;
&lt;p&gt;&lt;font face=Tahoma color="#68686a" size=2&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff"&gt;     ev.preventDefault();&lt;br&gt;}&lt;br&gt;document.addEventListener(&amp;quot;click&amp;quot;,doThis,false)&lt;br&gt;&amp;lt;/script&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;/font&gt;
&lt;p&gt;So the issue is, how do we generically &lt;em&gt;fix &lt;/em&gt;the incorrect firing of this event. In MSN, we have our compatibility layer (aka a simple &amp;quot;framework&amp;quot;) for abstracting browser differences.  In this file, we will add our Firefox specific work-around.  We are going to grab the document onclick event before it starts bubbling up the page.  If the event fires and the right mouse button is depressed, we are going to stop the entire event chain.  This is a very simple function:
&lt;p&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff"&gt;function ValidateButton(ev)&lt;br&gt;{&lt;br&gt;if (ev.button==2) // Right mouse button - stop this event&lt;br&gt;    ev.stopPropagation();&lt;br&gt;}&lt;/font&gt;
&lt;p&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff"&gt;// Grab this event handler before it bubbles (the &amp;quot;true&amp;quot; argument)&lt;br&gt;// Uncomment line below if this code is to also run in IE &lt;br&gt;// &lt;/font&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff"&gt;if (document.addEventListener) &lt;br&gt;&lt;/font&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff"&gt;document.addEventListener(&amp;quot;click&amp;quot;,ValidateButton,true);&lt;/font&gt;
&lt;p&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff"&gt;&lt;font face=Tahoma color="#68686a"&gt;Now, when our compatibility framework is included in our properties this issue is automatically fixed. I do not have to run around trying to educate everyone about this issue, nor does test have to keep retesting every property to see if it has been coded property. By having a framework, we are able to more efficiently respond to core issues, test it once, and deploy it globally.&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font face="Courier New, Courier, Monospace" color="#0000ff"&gt; &lt;/font&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Frameworks%2c+Firefox+and+the+right+click+button&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1109.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1109.entry</guid><pubDate>Wed, 29 Jun 2005 15:50:54 GMT</pubDate><slash:comments>48</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1109/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1109.entry#comment</wfw:comment><dcterms:modified>2005-07-02T22:19:43Z</dcterms:modified></item><item><title>My personal thoughts on an AJAX (DHTML) framework...</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1084.entry</link><description>&lt;p&gt;ScottGu made a &lt;a href="http://weblogs.asp.net/scottgu/archive/2005/06/28/416185.aspx"&gt;great post &lt;/a&gt;highlighting the scope of the Atlas project. Here are some of my personal thoughts on finally having a framework for building web applications. 
&lt;p&gt;Let's look at how an AJAX platform will enable more efficient and effective development of interactive applications. To better understand, let's walk way back into the history of DHTML. 
&lt;p&gt;AJAX is nothing new. DHTML was created to enable what we now call &amp;quot;AJAX&amp;quot;. Before DHTML, you could only do simple form validation. None of the page was accessible to scripts. When I authored the DHTML specifications in the mid-90s, my goal was to reflect all the document's markup into a live API. Modifying the markup is immediately reflected in the underlying objects, and modifying the objects is immediately reflected in the markup - all syncrhonized with the actual rendering. The page could update in response to any stimuli - whether a user event, a timer, or another asynchronous operation (e.g., loading data). We even had the concept of loading XML into the page for processing via XML data islands. This is the essence of the AJAX approach. 
&lt;p&gt;Back in 1997, I also started a web-site that illustrated lots of the DHTML capabilities. You can still find a couple of my early demo's from '97 that show asynchronously loading data and as you would expect, still run today (note they only work in IE as IE was the only capable browser at the time): 
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.siteexperts.com/paradise/getResource.asp?r_id=11"&gt;XML Weather Station&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.siteexperts.com/paradise/getResource.asp?r_id=10"&gt;XML Poetry&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.siteexperts.com/paradise/getResource.asp?r_id=133"&gt;Bound Favorite Links&lt;/a&gt; 
&lt;li&gt;&lt;a href="http://www.siteexperts.com/paradise/getResource.asp?r_id=104"&gt;Databound List Boxes&lt;/a&gt; &lt;/ul&gt;
&lt;p&gt;All these demonstrated the value and capabilities of DHTML. To start pushing the envelope, in '98 I developed a framework for building richer interactive web applications leveraging asynchronous communications, etc (small pieces of this effort surfaced on MSN Groups in 99). This effort did not catch on in the early days for a number of reasons. First, it was a very difficult programming pattern (at the time Javascript and the DOM were lacking a few very essential extensions and the IFrame approach for deployment was cumbersome). We had a bandwdth problems. The framework was code intensive that deploying over narrrowband (broadband was barely an infant) was problematic. While the PC back then had lots of horsepower, notebook video cards were often not sufficient for the advanced UI magic. 
&lt;p&gt;We also discovered in those early days it was often faster to reload small targeted pages then to run the application asynchronously. Furthermore, the environment was never (and for the most part still is not) designed to be a true application framework. This limited most asynchronous type approachs to populated listboxes, etc., rather than as a broad-based application model. 
&lt;p&gt;Last, we were very concerned about breaking the web model for traditional &amp;quot;web-like&amp;quot; applications. The back button and favorites are easily broken with richer applications. OWA survives because its intent is to be an application. However, imagine a search site where you hit the back button and instead of seeing the previous set of results, you are navigated to the page before your search. Solving this experience issue was and is still not trivial. 
&lt;p&gt;Today, we have the bandwidth, horsepower, and the browser reach to build richer experiences. Even so, no matter what anyone says, building more than a simple &amp;quot;AJAX&amp;quot; widget for the browser is not trivial. First, you must start with an asynchronous programming pattern. Next, you layer on top of that the sometimes overly flexible Javascript environment (easily leads to bad code - most developers don't use any sort of patterns or methodology). Finally you need to distinguish between the different browsers from an API, rendering, and even bug perspective. On top of all this, as I have stated for years, the web is analogous to a form's package, not an application package. For example, imagine you are a VB programmer and you had to develop your entire application on a single form. Now combine this with the page based web navigation model and things really start to get interesting (don't forget about the back button). Keep in mind I have not even mentioned integration with backend APIs, authentication, etc. This all leads to make the late 90's cross-browser rendering discussions look like a cakewalk. 
&lt;p&gt;So how can a framework help with all this? 
&lt;p&gt;The framework can help in lots of ways. When I think of framework, I think about a common API, methodology, and tools for building components and applications. Let's look at my simple examples above. I defined a custom approach for each demo for interacting with the backend. So let's standardize a way to build remote access to the backend. I defined a custom approach for integrating and establishing the control on the client. So let's standardize a way to enable client components. Back then this was IE only, how do I get this on other browsers? This is a little more difficult - you can solve API differences via a framework. A pattern can be devised for helping alleviate rendering differences in a modular and maintainable way (compared to the css parsing hacks used by many sites). Last, how do I make my components reusable? Apply object oriented patterns around the entire framework. Solving these issues are only the tip of the iceburg even when focusing on the client. You also want traditional core services around network, object lifecycle management, etc. 
&lt;p&gt;I haven't even begun to address the backend integration services necessary around authentication, storage, etc. As you read &lt;a href="http://weblogs.asp.net/scottgu/archive/2005/06/28/416185.aspx"&gt;ScottGu's blog entry&lt;/a&gt;, watch how Atlas and ASP.net is focusing on unifying these two worlds. 
&lt;p&gt; &lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+My+personal+thoughts+on+an+AJAX+(DHTML)+framework...&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1084.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1084.entry</guid><pubDate>Tue, 28 Jun 2005 21:10:46 GMT</pubDate><slash:comments>17</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1084/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1084.entry#comment</wfw:comment><dcterms:modified>2005-07-02T22:20:02Z</dcterms:modified></item><item><title>Microsoft announced the Atlas toolset for AJAX</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1065.entry</link><description>&lt;div&gt;Some great news is breaking this week.  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Microsoft announced &amp;quot;Atlas&amp;quot;, a new set of tools enable AJAX development, to be shipped later this year.  Building asynchronously-oriented applications can be very difficult.  Atlas is going to provide tools, frameworks, and patterns to reduce the cost and complexity of building Ajax-enabled functionality into your web pages. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Update: Scott Guthrie (PUM of asp.net) made a &lt;a href="http://weblogs.asp.net/scottgu/archive/2005/06/28/416185.aspx"&gt;great post&lt;/a&gt; that covers a lot of what I wanted to introduce (about the client frameworks)&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I will add links to different articles as they are published and comment more on this later.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;cNet: &lt;a href="http://news.com.com/Microsoft+gets+hip+to+AJAX/2100-1007_3-5765197.html"&gt;Microsoft gets hip to AJAX&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;eWeek: &lt;a href="http://www.eweek.com/article2/0,1759,1832206,00.asp"&gt;Microsoft Wants a Piece of the Ajax Action&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;InformationWeek: &lt;a href="http://www.informationweek.com/story/showArticle.jhtml?articleID=164903218&amp;amp;tid=5979"&gt;Microsoft Plans An Alternative To Ajax&lt;/a&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;To clarify, Atlas is not an alternative to Ajax.  Rather Atlas is the name of the toolset that embraces the Ajax pattern.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I wouldn't be surprised to see some posts in the near future on &lt;a href="http://www.platformonomics.com/"&gt;Charles Fitgeralds blog &lt;/a&gt;(GM of Platform Strategy) on this &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Microsoft+announced+the+Atlas+toolset+for+AJAX&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1065.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1065.entry</guid><pubDate>Tue, 28 Jun 2005 16:10:10 GMT</pubDate><slash:comments>20</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!1065/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!1065.entry#comment</wfw:comment><dcterms:modified>2005-07-02T22:20:10Z</dcterms:modified></item><item><title>IE Memory Leaks Revisited</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!909.entry</link><description>&lt;p&gt;A great article was just posted on MSDN that is a must read for anyone authoring complex scripts.  This article explains how and where IE leaks memory and offers suggestions to make your applications more stable. This is a great followup to my &lt;a href="http://spaces.msn.com/members/siteexperts/Blog/cns!1pNcL8JwTfkkjv4gg6LkVCpw!338.entry"&gt;short blog entry on the subject&lt;/a&gt;. &lt;p&gt;See &lt;a href="http://msdn.microsoft.com/library/en-us/IETechCol/dnwebgen/ie_leak_patterns.asp?frame=true"&gt;http://msdn.microsoft.com/library/en-us/IETechCol/dnwebgen/ie_leak_patterns.asp?frame=true&lt;/a&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+IE+Memory+Leaks+Revisited&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!909.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!909.entry</guid><pubDate>Wed, 22 Jun 2005 03:34:37 GMT</pubDate><slash:comments>58</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!909/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!909.entry#comment</wfw:comment><dcterms:modified>2005-07-02T22:20:31Z</dcterms:modified></item><item><title>When a var is not a var</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!418.entry</link><description>&lt;p&gt;Declaring your variables is extremely important when creating closures.  When a variable is referenced, the Javascript engine walks the scope chain to find the first instance. If the variable is not found, it gets created in the global scope. If you fail to properly define your variables, you will often get seemingly random results. While the errors below may appear to be obvious, I have seen them occur way to many times and for some reason they are often not found at first glance. &lt;p&gt;In the code below there are two scoping errors: &lt;p&gt;function ClosureDemo()&lt;br&gt;{&lt;br&gt;  var a = b = 0; &lt;p&gt;  doSomething = function()&lt;br&gt;  {&lt;br&gt;  }&lt;br&gt; &lt;br&gt;  this.Test = function()&lt;br&gt;  {&lt;br&gt;    a++;&lt;br&gt;    b++;&lt;br&gt;  }&lt;br&gt;} &lt;p&gt;The first error is in the declaration of the a and b variable.  In the above code, I only declared the variable a in the scope of the function.  Variable b is not declared, and was merely initialized to 0.  Instead, since variable b is not being declared, the variable will be created (if necessary) in the global scope and initialized to 0.  Now, b, instead of being a variable local to each instance of the closure, acts as a global variable. &lt;p&gt;The second error is in the definition of the doSomething function. doSomething is actually a variable, and it is being assigned a function. This mistake occurs because javascript developers sometimes forget that assigning a function to a variable is no different than assigning any other value. We just made the same mistake we made with the b variable.  doSomething is being created in the global scope rather than the local scope of the closure. &lt;p&gt;We correct the closure below: &lt;p&gt;function ClosureDemo()&lt;br&gt;{&lt;br&gt;  var a = 0;&lt;br&gt;  var b = 0; &lt;p&gt;  var doSomething = function()&lt;br&gt;  {&lt;br&gt;  } &lt;p&gt;  function AnotherSomething()  // Alternative to the anonymous function above&lt;br&gt;  {&lt;br&gt;  }&lt;br&gt; &lt;br&gt;  this.Test = function()&lt;br&gt;  {&lt;br&gt;    a++;&lt;br&gt;    b++;&lt;br&gt;  }&lt;br&gt;}&lt;br&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+When+a+var+is+not+a+var&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!418.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!418.entry</guid><pubDate>Tue, 05 Apr 2005 00:20:50 GMT</pubDate><slash:comments>45</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!418/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!418.entry#comment</wfw:comment><dcterms:modified>2005-04-05T00:20:50Z</dcterms:modified></item><item><title>AJAX or as I like to call it, DHTML</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!380.entry</link><description>&lt;p&gt;&lt;br&gt;Lately there has been significant buzz about a new way to build web-apps called AJAX (Asynchronous Javascript and XML).  I have always called this DHTML, but Ajax is a catchy name. If Ajax gets people excited about rich web applications, than it is a great name. &lt;p&gt;As Adam Bosworth explained on &lt;a href="http://www.25hoursaday.com/weblog/PermaLink.aspx?guid=0cca0b0e-4724-404f-bc43-32a66245abef" target="_blank"&gt;Dare's blog&lt;/a&gt;, we built Ajax-like web applications back in 1997 during and after shipping IE4 (I drove the design of DHTML and worked closely with the W3C during this period).  At that time xmlhttp (or xml for that matter) did not exist. Instead, structured data was passed back and forth encapsulated in Javascript via hidden IFrames.  This experimental work helped prove the need for a structured, standardized approach for managing and transporting data. &lt;p&gt;Over the years, quite a few web applications have been built using similar approaches - many are Intranet applications and one of the best was Outlook Web Access. However, very few main-stream web-sites appeared. I believe this was due to a number of factors - the largest being that the typical web user-experience falls apart when you start building web-based applications.  The user-interface issues revolve mostly around history and refresh. (For example - In GMail, navigate around your inbox and either refresh the page or use the back button. In Spaces (IE Users), expand and view comments and hit the back button.  I am willing to wager that what happens is not what you really want).  The problem lies in we are building rich applications in an immature application environment. We are essentially attempting to morph the current state of the browser from a dynamic form package to a rich application platform.  &lt;p&gt;I do credit Google for publically pushing the envelope for rich web applications (although I am still curious as to my Mom's reaction/ confusion as she attempts to navigate). This paradigm shift is much overdue and forces us to focus on delivering the best features with the best experience to our customers.   &lt;p&gt;Just like I believe the early experiments on the web led to the applications today, these applications defined by rich customer and social networking experiences are going to drive requirements for the technologies tomorrow. I still view the web as being very immature and we are starting to enter a new phase in the web's evolution.   &lt;p&gt;While I am not going to make any predictions, I know I am looking beyond Ajax and what I see is very exciting.  &lt;p&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+AJAX+or+as+I+like+to+call+it%2c+DHTML&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!380.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!380.entry</guid><pubDate>Fri, 25 Mar 2005 06:36:48 GMT</pubDate><slash:comments>20</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!380/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!380.entry#comment</wfw:comment><dcterms:modified>2005-03-25T07:27:17Z</dcterms:modified></item><item><title>Talking about JavaScript Scoping Explored</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!373.entry</link><description>&lt;p&gt;John, one of the developers on our team posted a very clear explanation of JavaScript scoping rules and compares it to traditional C/C++/C#.  I highly recommend checking this out if you want to learn more about the Javascript &lt;em&gt;this &lt;/em&gt;statement.  &lt;p&gt;Scott  &lt;p&gt;  &lt;p&gt;&lt;em&gt;Quote&lt;/em&gt;  &lt;blockquote&gt;&lt;a href="http://spaces.msn.com/members/johnkountz/blog/cns!1pE08yLveUtgHBbJQy0b-0Wg!260.entry"&gt;JavaScript Scoping Explored&lt;/a&gt;&lt;br&gt; &lt;p&gt;&lt;font face="Times New Roman" size=3&gt;JavaScript’s scoping rules are uniquely different from what C/C++ or C# programmers are used-to. Scoping rules determine what variables are visible at any point during execution of a program. Consider the following...&lt;/font&gt;&lt;/blockquote&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-3572391539995137421&amp;page=RSS%3a+Talking+about+JavaScript+Scoping+Explored&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=siteexperts.spaces.live.com&amp;amp;GT1=siteexperts"&gt;</description><comments>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!373.entry#comment</comments><guid isPermaLink="true">http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!373.entry</guid><pubDate>Tue, 22 Mar 2005 03:31:58 GMT</pubDate><slash:comments>24</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://siteexperts.spaces.live.com/blog/cns!CE6C50D25BFAAA73!373/comments/feed.rss</wfw:commentRss><wfw:comment>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!373.entry#comment</wfw:comment><dcterms:modified>2005-03-25T07:27:31Z</dcterms:modified></item><item><title>JavaScript singleton objects (and how to avoid polluting the global namespace)</title><link>http://siteexperts.spaces.live.com/Blog/cns!CE6C50D25BFAAA73!359.entry</link><description>&lt;p&gt;Today, most client scripts consist of a large number of global variables. Most of the time, global variables are a bad idea. Fortunately, there is a way to minimize your use of global variables and to provide proper encapsulation of functionality and state. &lt;p&gt;This leads us to our next technique - how to use javascript closures to create singleton objects.  As usual, we will demonstrate by example: &lt;p&gt;MyApplication = new function()&lt;br&gt;{&lt;br&gt;  var privateState = 0;&lt;br&gt;  var privateState2 = &amp;quot;abc&amp;quot;;&lt;br&gt;  &lt;br&gt;  function ProcessState()&lt;br&gt;  {&lt;br&gt;    // Private function to the application class&lt;br&gt;  }&lt;br&gt;&lt;br&gt;  // Public methods on the singleton object&lt;br&gt;  this.GetState = function()&lt;br&gt;  {&lt;br&gt;    return privateState;&lt;br&gt;  }&lt;br&gt;&lt;br&gt;  this.Execute = function()&lt;br&gt; {&lt;br&gt; }&lt;br&gt;} &lt;p&gt;In this example, we created a single instace of the MyApplication object.  This instance is immediately instantiated as the page is parsed (notice the &amp;quot;new&amp;quot; when we assign to the MyApplication object). Once instantiated, you can call the public methods on the MyApplication object as follows: &lt;p&gt;MyApplication.Execute() // Call execute&lt;br&gt;var s = MyApplication.GetState() // Get the state &lt;p&gt;Note that you cannot call or access the private variables of MyApplication outside the scope of the instance.  &lt;p&gt;By leveraging this technique, you can apply proper e