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

<channel>
	<title>Danny Thorpe &#187; Web</title>
	<atom:link href="http://dannythorpe.com/tag/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://dannythorpe.com</link>
	<description>Dream &#38; Deliver</description>
	<lastBuildDate>Wed, 04 Jan 2012 21:20:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HTML 5 Linking Proposal: Depth for Every Element</title>
		<link>http://dannythorpe.com/2008/07/25/html-5-linking-proposal-depth-for-every-element/</link>
		<comments>http://dannythorpe.com/2008/07/25/html-5-linking-proposal-depth-for-every-element/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 17:40:12 +0000</pubDate>
		<dc:creator>Danny Thorpe</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://dannythorpe.com/2008/07/25/html-5-linking-proposal-depth-for-every-element/</guid>
		<description><![CDATA[Eric Meyer has put together a proposal for HTML 5 to enable an HTML document to associate URL links with just about every visual HTML element type. This would make it much easier to make a blockquote link to the source of the quote, and would enable things that are currently impossible in HTML such <a href='http://dannythorpe.com/2008/07/25/html-5-linking-proposal-depth-for-every-element/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://meyerweb.com/eric/thoughts/2008/07/23/any-element-linking-demo/">Eric Meyer</a> has put together <a href="http://meyerweb.com/eric/html-xhtml/html5-linking.html">a proposal for HTML 5 to enable an HTML document to associate URL links</a> with just about every visual HTML element type.  This would make it much easier to make a blockquote link to the source of the quote, and would enable things that are currently impossible in HTML such as making an entire row of a table into a link.</p>
<p>The proposal outlines several possible avenues for extending HTML syntax and considers their repercussions for functionality and backwards compatibility.  Most of the extension choices can be supported in older browsers using JavaScript to backfill support for the HTML attributes the browser doesn&#8217;t understand.</p>
<p>I like the idea of allowing any element, even large blocks, to have an optional link associated with it. This improves the scope of reference to more naturally reflect the semantic structure of the referring document.  If you quote a whole paragraph from somewhere else, doesn&#8217;t it make more sense that the entire quote be a live link to the original source?  The current HTML link patterns force you to inject awkward transition text into the article just so you can have something to hang a link off of.  I find such callouts disruptive to the flow of narrative text.  Callouts often give the reference too much visibility relative to the content around them &#8211; another distraction.</p>
<p>Decreasing the need for artificial link phrases could be a benefit and burden for search engines.  Search engines typically place a lot of weight on what words are used in the reference to associate some keyword digest of what the referenced page is about. This is a key technique for finding images with text search queries. How does a search engine deduce that &#8220;DSC10034.jpg&#8221; is an image of a horse?  By noting that three different pages link to it, and the text of the links contains the word &#8220;horse&#8221;.</p>
<p>A block quote or table row that references another document would likely overload the simple referring text search engine technique with too much data, so the link would not be as strong of a keyword signal as two or three word phrase calculated by a human semantic engine.  On the other hand, human digests are notoriously bad.  Mislabeling is extremely common on the web, either by ignorance, apathy, or malicious intent.  (Somebody actually tagged my photo of an Adelie penguin as a &#8220;parrot&#8221;!  Gah!)</p>
<p>Eric has a <a href="http://meyerweb.com/eric/html-xhtml/html5-linking-demo.html">demo page</a> showing how one of the HTML extension options might look like, and how JavaScript can backfill for browsers that don&#8217;t understand the extensions.</p>
<p>Keep in mind while tinkering with the demo that the proposal is about extending what information can be <em>represented</em> in HTML syntax &#8211; the proposal is not about how an HTML renderer would present that information on the screen.  I absolutely not want entire blocks or table rows drawn with the traditional underscored text of a hyperlink.</p>
<p>Certainly, a page that uses links for blockquotes or table rows could define its own CSS style elements to make the linked element less obnoxious to the eye. I would hope for more subtle visual cues that let the reader know that the linked element has more information, more depth of content, available for drilldown without disrupting the flow of the eye across the page. I would also hope that browsers that support these HTML link extensions will consider these distinctions between a &#8220;hard&#8221; a link and a more subtle content drill-down link when setting their default rendering styles.</p>
<p>Discovered via <a href="http://ajaxian.com/archives/html-5-linking-all-around-the-horn">Ajaxian</a></p>
<div style="text-align:center;width:100%;"><div style="margin:0px 0px 0px 0px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-0861479594738165";
/* End of Post */
google_ad_slot = "6510912161";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></div><p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fdannythorpe.com%2F2008%2F07%2F25%2Fhtml-5-linking-proposal-depth-for-every-element%2F&amp;counturl=http%3A%2F%2Fdannythorpe.com%2F2008%2F07%2F25%2Fhtml-5-linking-proposal-depth-for-every-element%2F&amp;count=none&amp;text=HTML%205%20Linking%20Proposal%3A%20Depth%20for%20Every%20Element" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fdannythorpe.com%2F2008%2F07%2F25%2Fhtml-5-linking-proposal-depth-for-every-element%2F&amp;counturl=http%3A%2F%2Fdannythorpe.com%2F2008%2F07%2F25%2Fhtml-5-linking-proposal-depth-for-every-element%2F&amp;count=none&amp;text=HTML%205%20Linking%20Proposal%3A%20Depth%20for%20Every%20Element" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fdannythorpe.com%2F2008%2F07%2F25%2Fhtml-5-linking-proposal-depth-for-every-element%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fdannythorpe.com%2F2008%2F07%2F25%2Fhtml-5-linking-proposal-depth-for-every-element%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdannythorpe.com%2F2008%2F07%2F25%2Fhtml-5-linking-proposal-depth-for-every-element%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdannythorpe.com%2F2008%2F07%2F25%2Fhtml-5-linking-proposal-depth-for-every-element%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdannythorpe.com%2F2008%2F07%2F25%2Fhtml-5-linking-proposal-depth-for-every-element%2F&amp;title=HTML%205%20Linking%20Proposal%3A%20Depth%20for%20Every%20Element" id="wpa2a_4">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://dannythorpe.com/2008/07/25/html-5-linking-proposal-depth-for-every-element/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Classmates.com Cancels IPO</title>
		<link>http://dannythorpe.com/2007/12/13/classmatescom-cancels-ipo/</link>
		<comments>http://dannythorpe.com/2007/12/13/classmatescom-cancels-ipo/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 18:57:49 +0000</pubDate>
		<dc:creator>Danny Thorpe</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[IPO]]></category>
		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://dannythorpe.com/2007/12/13/classmatescom-cancels-ipo/</guid>
		<description><![CDATA[The New York Times reports that United Media has withdrawn its proposal to IPO its Classmates.com unit. United Media cited &#8220;unfavorable market conditions&#8221; for the withdrawal, but Cowen &#38; Co. analyst Jim Friedland puts it more bluntly: “We expect the Classmates.com subscriber base to peak in the first half of 2008, followed by a steady <a href='http://dannythorpe.com/2007/12/13/classmatescom-cancels-ipo/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.nytimes.com/paidcontent/PCORG_317818.html">New York Times reports</a> that United Media has withdrawn its proposal to IPO its Classmates.com unit.</p>
<p>United Media cited &#8220;unfavorable market conditions&#8221; for the withdrawal, but Cowen &amp; Co. analyst Jim Friedland puts it more bluntly: “We expect the Classmates.com subscriber base to peak in the first half of 2008, followed by a steady decline to zero by 2012.”</p>
<p><em>Ouch!</em></p>
<p>Classmates.com is a paid subscription site that apparently doesn&#8217;t have much of a plan for how to compete against free sites like Facebook that provide better services and larger social networks.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F12%2F13%2Fclassmatescom-cancels-ipo%2F&amp;counturl=http%3A%2F%2Fdannythorpe.com%2F2007%2F12%2F13%2Fclassmatescom-cancels-ipo%2F&amp;count=none&amp;text=Classmates.com%20Cancels%20IPO" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F12%2F13%2Fclassmatescom-cancels-ipo%2F&amp;counturl=http%3A%2F%2Fdannythorpe.com%2F2007%2F12%2F13%2Fclassmatescom-cancels-ipo%2F&amp;count=none&amp;text=Classmates.com%20Cancels%20IPO" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F12%2F13%2Fclassmatescom-cancels-ipo%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F12%2F13%2Fclassmatescom-cancels-ipo%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdannythorpe.com%2F2007%2F12%2F13%2Fclassmatescom-cancels-ipo%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdannythorpe.com%2F2007%2F12%2F13%2Fclassmatescom-cancels-ipo%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdannythorpe.com%2F2007%2F12%2F13%2Fclassmatescom-cancels-ipo%2F&amp;title=Classmates.com%20Cancels%20IPO" id="wpa2a_8">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://dannythorpe.com/2007/12/13/classmatescom-cancels-ipo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML Namespace Attributes and IE document.namespaces</title>
		<link>http://dannythorpe.com/2007/05/27/html-namespace-attributes-and-ie-document-namespaces/</link>
		<comments>http://dannythorpe.com/2007/05/27/html-namespace-attributes-and-ie-document-namespaces/#comments</comments>
		<pubDate>Sun, 27 May 2007 21:27:26 +0000</pubDate>
		<dc:creator>Danny Thorpe</dc:creator>
				<category><![CDATA[Windows Live Quantum Mechanics]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows Live]]></category>

		<guid isPermaLink="false">http://dannythorpe.com/2007/05/27/html-namespace-attributes-and-ie-document-namespaces/</guid>
		<description><![CDATA[A few posts ago I promised to elaborate on a little gotcha that bit us in the butt while prepping the &#8220;blocks&#8221; to enable Popfly apps to use the Windows Live Contacts web control and Windows Live Spaces web control .&#160; Here it is:&#160; IE has a handy document.namespaces object that reflects the namespaces defined <a href='http://dannythorpe.com/2007/05/27/html-namespace-attributes-and-ie-document-namespaces/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://blogs.msdn.com/dthorpe/archive/2007/05/18/popfly-mashups-made-easy.aspx">few posts ago</a> I promised to elaborate on a little gotcha that bit us in the butt while prepping the &#8220;blocks&#8221; to enable Popfly apps to use the <a href="http://dev.live.com/contactscontrol/">Windows Live Contacts web control</a> and <a href="http://dev.live.com/spacescontrol">Windows Live Spaces web control</a> .&nbsp; </p>
<p><strong>Here it is:</strong>&nbsp; IE has a handy document.namespaces object that reflects the namespaces defined in attributes of the HTML element of the page.&nbsp; </p>
<p><strong>The gotcha:</strong>&nbsp; document.namespaces does not track with attributes that are dynamically added to the HTML element after page load.</p>
<p><strong>The situation:</strong> &#8220;blocks&#8221; in Popfly can emit HTML code to set up shop in the application host page, but they do not have control over the host page&#8217;s HTML tag.&nbsp; Since our web controls pretty much requires namespaces (that&#8217;s a bug -&nbsp;they should work with or without namespaces), we tossed in a quick fix in the Popfly block:&nbsp; look up the html element and use setAttribute to set the namespace attributes we would have set on the html tag if we had access to it.</p>
<p><strong>Result:</strong>&nbsp; worked great in Firefox, but that was only because Firefox doesn&#8217;t provide any support for namespaces in HTML docs.&nbsp; I ranted on this <a href="http://blogs.msdn.com/dthorpe/archive/2006/12/18/namespaces-in-html-too-much-trouble-to-bother-with.aspx">awhile back</a>.&nbsp; You have to serve up content type text/xml in order to get Firefox&#8217;s namespace support to kick in, but doing that kills all the JavaScript on your page, among other things, and in general one should not take lightly renaming HTML as XML or visa-versa.&nbsp; It&#8217;ll sneak up and bite you when you least have time to deal with it.</p>
<p><strong>Result2:</strong> Didn&#8217;t work in IE.&nbsp; Our bootstrap code in the contacts control takes advantage of document.namespaces in IE, and falls back to savage spelunking to find the namespace attributes the hard way in Firefox and other browsers.&nbsp; document.namespaces is populated when the html document is being loaded and is not updated after it has loaded.&nbsp; Our quick fix of adding the namespace attributes to the html element in our Popfly code block had no effect because they were added after document.namespaces was locked down.</p>
<p><strong>Solution:</strong>&nbsp; Change the Popfly code block to call document.namespaces.add() if document.namespaces exists, otherwise add the namespace attributes to the html element.&nbsp; Do it. Test it. Ship it.&nbsp;Whew!</p>
<p><em>This post was originally published on my <a href="http://blogs.msdn.com/b/dthorpe/archive/2007/05/27/html-namespace-attributes-and-ie-document-namespaces.aspx">MSDN blog</a> while I was at Microsoft.</em></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F27%2Fhtml-namespace-attributes-and-ie-document-namespaces%2F&amp;counturl=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F27%2Fhtml-namespace-attributes-and-ie-document-namespaces%2F&amp;count=none&amp;text=HTML%20Namespace%20Attributes%20and%20IE%20document.namespaces" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F27%2Fhtml-namespace-attributes-and-ie-document-namespaces%2F&amp;counturl=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F27%2Fhtml-namespace-attributes-and-ie-document-namespaces%2F&amp;count=none&amp;text=HTML%20Namespace%20Attributes%20and%20IE%20document.namespaces" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F27%2Fhtml-namespace-attributes-and-ie-document-namespaces%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F27%2Fhtml-namespace-attributes-and-ie-document-namespaces%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F27%2Fhtml-namespace-attributes-and-ie-document-namespaces%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F27%2Fhtml-namespace-attributes-and-ie-document-namespaces%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F27%2Fhtml-namespace-attributes-and-ie-document-namespaces%2F&amp;title=HTML%20Namespace%20Attributes%20and%20IE%20document.namespaces" id="wpa2a_12">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://dannythorpe.com/2007/05/27/html-namespace-attributes-and-ie-document-namespaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More: Avoiding Popup Windows in Your Web Apps</title>
		<link>http://dannythorpe.com/2007/05/22/more-avoiding-popup-windows-in-your-web-apps/</link>
		<comments>http://dannythorpe.com/2007/05/22/more-avoiding-popup-windows-in-your-web-apps/#comments</comments>
		<pubDate>Wed, 23 May 2007 04:10:34 +0000</pubDate>
		<dc:creator>Danny Thorpe</dc:creator>
				<category><![CDATA[Windows Live Quantum Mechanics]]></category>
		<category><![CDATA[popups]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Windows Live]]></category>

		<guid isPermaLink="false">http://dannythorpe.com/2007/05/22/more-avoiding-popup-windows-in-your-web-apps/</guid>
		<description><![CDATA[Scott Isaacs shares some additional &#8220;best practices&#8221; points on dealing with popup windows and popup blockers: Always program window.open() very defensively&#8230; Always try catch any calls to window.open() and if you are retaining a reference to the window (e.g., var w = window.open(…)), always make sure the “w” is a valid object (and again try <a href='http://dannythorpe.com/2007/05/22/more-avoiding-popup-windows-in-your-web-apps/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://weblogging.com/">Scott Isaacs</a> shares some additional &#8220;best practices&#8221; points on dealing with popup windows and popup blockers:</p>
<blockquote><p>Always program window.open() very defensively&#8230;</p>
<p>Always try catch any calls to window.open() and if you are retaining a reference to the window (e.g., var w = window.open(…)), always make sure the “w” is a valid object (and again try catch your first attempt to leverage the window).&nbsp; </p>
<p>Last, it was recently discovered that Symantec’s internet products have a popup blocker that actually augments the web page with their own custom script. This script disables any calls to window.open() that may occur before the onload event of the page. Therefore, if the user quickly clicks a hyperlink that calls window.open before the page loads, the user will see either nothing happen or receive a script error.&nbsp; </p>
</blockquote>
<p>I heartily agree.&nbsp; The&nbsp;variable assigned the return value of window.open() (&#8220;w&#8221; above) is particularly obnoxious.&nbsp; It can fail to be initialized if the window.open() failed or took an unexpected detour due to popup blockers.&nbsp; Once the popup window is up and running, the &#8220;w&#8221; variable will again be at risk when the user closes the popup window.&nbsp; The &#8220;w&#8221; variable will be unusable after the window it refers to is closed &#8211; it&#8217;s almost as though the object it refers to has been garbage collected out from under the variable.&nbsp; Any reference to the variable will raise an exception.&nbsp; Testing for <strong>typeof w == &#8220;undefined&#8221;</strong> isn&#8217;t entirely reliable across browsers because for the brief period while the window is closing &#8220;w&#8221;&nbsp;may&nbsp;be unusable but not undefined.</p>
<p>For the <a href="http://dev.live.com/contactscontrol/">Windows Live Contacts web control</a> we ultimately solved these quasi state problems with the popup window variable&nbsp;once and for all by eliminating the variable!&nbsp; Instead of having the main page hold onto a variable pointing to the popup window&nbsp;so that the main window&nbsp;code could check the state of what&#8217;s going on in the&nbsp;popup, we turned everything inside out so that the popup calls or writes back to the main window.&nbsp; This arrangement allows the main window to create the popup, set a state variable to indicate that the popup is up, and then forget about it.&nbsp; When the popup is closed, it will call back to the main page to clear the state variable and set the result of the operation.</p>
<p>Another thing to watch out for when you have multiple windows in your web app:&nbsp; Firefox 1.x does not do well with executing script while a window is closing.&nbsp;&nbsp;If the popup window is&nbsp;in the process of closing and&nbsp;calls into&nbsp;a JavaScript method on the main page&nbsp;which fires off a new XMLHttpRequest, chances are high that the XMLHttpRequest will implode in its onReadyStateChanged event.&nbsp; Accessing any field or method of the XMLHttpRequest object will throw an exception, and all subsequent XMLHttpRequests (even new instances) will be fried.&nbsp; The only way to clear this state appears to be to reload the main page.&nbsp;&nbsp;I don&#8217;t recall offhand if this has been fixed already in Firefox 2.0, but it&#8217;s a known, logged issue in Firefox 1.x</p>
<p>The best&nbsp;solution is to&nbsp;avoid the problem by not initiating&nbsp;an XMLHttpRequest in a call chain started&nbsp;by a window close event.&nbsp; Use a short timer to decouple the closing popup window&#8217;s call context from the desired XMLHttpRequest action.</p>
<p><em>This post was originally published on my <a href="http://blogs.msdn.com/b/dthorpe/archive/2007/05/22/more-avoiding-popup-windows-in-your-web-apps.aspx">MSDN blog</a> while I was at Microsoft.</em></p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F22%2Fmore-avoiding-popup-windows-in-your-web-apps%2F&amp;counturl=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F22%2Fmore-avoiding-popup-windows-in-your-web-apps%2F&amp;count=none&amp;text=More%3A%20Avoiding%20Popup%20Windows%20in%20Your%20Web%20Apps" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F22%2Fmore-avoiding-popup-windows-in-your-web-apps%2F&amp;counturl=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F22%2Fmore-avoiding-popup-windows-in-your-web-apps%2F&amp;count=none&amp;text=More%3A%20Avoiding%20Popup%20Windows%20in%20Your%20Web%20Apps" scrolling="no" style="border:none;overflow:hidden;width:55px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F22%2Fmore-avoiding-popup-windows-in-your-web-apps%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F22%2Fmore-avoiding-popup-windows-in-your-web-apps%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F22%2Fmore-avoiding-popup-windows-in-your-web-apps%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F22%2Fmore-avoiding-popup-windows-in-your-web-apps%2F&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdannythorpe.com%2F2007%2F05%2F22%2Fmore-avoiding-popup-windows-in-your-web-apps%2F&amp;title=More%3A%20Avoiding%20Popup%20Windows%20in%20Your%20Web%20Apps" id="wpa2a_16">Share/Bookmark</a></p>]]></content:encoded>
			<wfw:commentRss>http://dannythorpe.com/2007/05/22/more-avoiding-popup-windows-in-your-web-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  dannythorpe.com/tag/web/feed/ ) in 0.38429 seconds, on Feb 7th, 2012 at 10:53 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 7th, 2012 at 11:53 am UTC -->
