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

<channel>
	<title>Web 3.0, 6 Bladed Razors, 7 Minute Abs &#187; Internet Explorer</title>
	<atom:link href="http://www.zachleat.com/web/tag/internet-explorer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zachleat.com/web</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 17:09:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Et tu, X-UA-Compatible?</title>
		<link>http://www.zachleat.com/web/et-tu-x-ua-compatible/</link>
		<comments>http://www.zachleat.com/web/et-tu-x-ua-compatible/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 05:34:14 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Browsers]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[User Agent Sniffing]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/?p=889</guid>
		<description><![CDATA[Or, the story of how I learned that the X-UA-Compatible header/meta tag is NOT the same as the Internet Explorer 8+ Compatibility View button. Please note that the following information may be common knowledge, as this behavior is as described in the pre-requisite Microsoft documentation on the subject. However, I feel this behavior to be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/jedibfa/5067647765/"><img src="http://www.zachleat.com/web/wp-content/uploads/2011/02/juliusceasar.jpg" alt="" title="Julius Ceasar" style="width: 300px" class="alignright size-full wp-image-899" /></a>Or, the story of how I learned that <strong>the X-UA-Compatible header/meta tag is NOT the same as the Internet Explorer 8+ Compatibility View button</strong>.</p>
<p><em>Please note that the following information may be common knowledge, as this behavior is as described in the pre-requisite <a href="http://blogs.msdn.com/b/ie/archive/2010/10/19/testing-sites-with-browser-mode-vs-doc-mode.aspx">Microsoft documentation</a> on the subject. However, I feel this behavior to be unintuitive and requiring more explicit communication.</em></p>
<div style="clear: both"></div>
<p>Library developers live in a much different world from full stack developers.  If you&#8217;re supplying code that will be used by others, you&#8217;re faced with a different set of priorities.  As such, the library I manage provides certain user agent sniffing conveniences, namely classes to replace CSS Hacks (similar to the approach used in HTML Boilerplate to provide ie6 through ie9 classes on the <code>&lt;html&gt;</code> tag) and JavaScript booleans (similar to <a href="http://api.jquery.com/jQuery.browser"><code>jQuery.browser</code></a>).  Much like jQuery, <a href="http://docs.jquery.com/Release:jQuery_1.3#No_More_Browser_Sniffing">these conveniences remain</a> for backwards compatibility.</p>
<p>The purpose of this post is in fact not to convince you whether or not User Agent Sniffing is a <a href="http://infrequently.org/2011/01/cutting-the-interrogation-short/">good tradeoff for performance</a> (even though, in some cases I believe it is), but instead to provide further evidence that using the User Agent alone is an unreliable method to determine the rendering engine of the web browser, and must be complemented with other approaches.  <strong>If you&#8217;re going to sniff, you have to sniff harder.</strong></p>
<h2>X-UA-Compatible Breaks navigator.userAgent</h2>
<p>Microsoft defines two terms to help communicate how new versions of Internet Explorer render a page: Browser Mode and Document Mode.  Browser Modes are determined prior to any request made to the server (and cannot be changed by web developers).  If the user triggers an IE7 Browser Mode using the Compatibility View Button, a new request is made to the server.  Document Modes are determined in the page response.</p>
<h3>Compatibility View Button Flow</h3>
<ol>
<li>User presses the Compatibility View button. This changes the Browser Mode.</li>
<li>Request sent (since the Browser Mode has changed, <strong>the User-Agent is also changed</strong> to MSIE 7.0)</li>
<li>Response from Server</li>
<li>Document Mode determined</li>
</ol>
<h3>X-UA-Compatible Flow</h3>
<ol>
<li>Internet Explorer uses the default Browser Mode (newest available in the browser)</li>
<li>Request sent (Browser Mode determines User-Agent to send, probably MSIE 8.0 or MSIE 9.0)</li>
<li>Response from Server.  Content may include X-UA-Compatible <code>&lt;meta&gt;</code> tag and/or Response HTTP headers such as X-UA-Compatible).</li>
<li>Document Mode determined, using X-UA-Compatible and the DocType</li>
</ol>
<p>If a X-UA-Compatible header is sent back in the Compatibility View flow, it will take precedence but obviously will not change the request User-Agent HTTP header.</p>
<p>It&#8217;s important to note that since the request has already gone before the Document Mode is determined, the Document Mode has no bearing on the request User-Agent HTTP header.  <del datetime="2011-11-05T19:40:06+00:00">While Microsoft probably could have changed <code>navigator.userAgent</code> to be different than the request User-Agent HTTP header, I feel they made the correct decision is keeping the same value.</del>  <code>navigator.userAgent</code> remains the same value as the request User-Agent HTTP header in IE8, but Microsoft changed this behavior in IE9. In IE9, <code>navigator.userAgent</code> represents the document mode, not the request User-Agent header.</p>
<p><img src="http://www.zachleat.com/web/wp-content/uploads/2011/02/Screen-shot-2011-02-06-at-1.27.14-PM.png" alt="" title="Screenshot of Microsoft Documentation" width="379" height="139" class="alignright size-full wp-image-896" />The User Agent isn&#8217;t the only thing being determined. The prerequisite Microsoft documentation states that the Browser Mode determines the User Agent, Default Document Mode, and Conditional Comments.  This is not accurate.  <strong>The Document Mode determines which Conditional Comments execute, not the Browser Mode.</strong></p>
<p>Also note that using IE&#8217;s <strong>Conditional Compilation</strong> feature to return the version of JScript will be the same, independent of Document Mode.</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">var ie = /*@cc_on @_jscript_version+@*/0;
// Always returns 5.8 in IE8, independent of Document Mode.</pre></div></div>

<p><em>Example Code from <a href="https://github.com/scottjehl/Respond/blob/aedc482328a4cbd9d74c5de178eb2cb974b67af5/respond.src.js#L171">Scott Jehl&#8217;s respond.js</a></em></p>
<h3>Test Pages</h3>
<p>Try the following tests in Internet Explorer 8+ to test for yourself.</p>
<ul>
<li><a href="/test/x-ua-compatible/index.html">Stock Page</a></li>
<li><a href="/test/x-ua-compatible/ie7.html">Setting X-UA-Compatible IE=7 using a Meta Tag</a> (or <a href="/test/x-ua-compatible/emulateie7.html">IE=EmulateIE7</a>)</li>
<li><a href="/test/x-ua-compatible/header-ie7/ie7.html">Setting X-UA-Compatible IE=7 using an HTTP Header</a> (or <a href="/test/x-ua-compatible/header-emulateie7/emulateie7.html">IE=EmulateIE7</a>)</li>
</ul>
<h2>What Does This Mean?</h2>
<p>If you use X-UA-Compatible to change the Document Mode/IE Trident rendering engine, any client side code relying on <code>navigator.userAgent</code> (such as jQuery.browser) or server side code relying on the User-Agent HTTP Header will be incorrect.  Since we can&#8217;t rely on the User Agent, what can we use?  Microsoft does provide a <code>document.documentMode</code> integer we could use, pretty easily.  But, I think there is a better approach.</p>
<p>Consider <a href="https://gist.github.com/527683">a great piece of JavaScript written by James Padosley</a> to find Internet Explorer version numbers using Conditional Comments.  His code seemed to meld perfectly with the above realization that the Document Mode determines Conditional Comment execution.  We can use this to fix <code>jQuery.browser</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">// Place this script after jQuery, but before any code that uses jQuery.browser
// Modified to only test for IE 6+, since jQuery only supports 6+
(function($)
{
    if(!$.browser.msie) {
        return;
    }
&nbsp;
    var v = 5,
        div = document.createElement('div'),
        all = div.getElementsByTagName('i');
&nbsp;
    while (
        div.innerHTML = '&lt;!--[if gt IE ' + (++v) + ']&gt;&lt;i&gt;&lt;/i&gt;&lt;![endif]--&gt;',
        all[0]
    );
&nbsp;
    $.browser.version = v;
})(jQuery);</pre></div></div>

<p>Now, of course, since we&#8217;re creating nodes there is a small performance penalty in using the above script over Regular Expressions and document.documentMode.  I feel this to be worthwhile, given that I&#8217;ve been <a href="/web/2008/10/19/jquery-bug-ie-reports-incorrect-browserversion/">burned by Internet Explorer&#8217;s version number before</a>.  But next time, I reserve the right to choose performance over simplicity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/et-tu-x-ua-compatible/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Internet Explorer Array.sort Unreliable</title>
		<link>http://www.zachleat.com/web/array-sort/</link>
		<comments>http://www.zachleat.com/web/array-sort/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 02:09:52 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[JScript]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/?p=568</guid>
		<description><![CDATA[What would you expect to be the result of executing the following code? // Create a medium size array, at least 100 items var obj = &#91;&#93;; for&#40;var j=0, k=150; j&#60;k; j++&#41; &#123; // the value here doesn't matter. obj.push&#40;'ABCD'+j&#41;; &#125; &#160; // Sort the array alphabetically. obj.sort&#40;function&#40;m,p&#41;&#123; m=&#40;''+m&#41;.toLowerCase&#40;&#41;; p=&#40;''+p&#41;.toLowerCase&#40;&#41;; &#160; if&#40;m &#62; p&#41; return [...]]]></description>
			<content:encoded><![CDATA[<p>What would you expect to be the result of executing the following code?</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Create a medium size array, at least 100 items</span>
<span style="color: #003366; font-weight: bold;">var</span> obj <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> j<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> k<span style="color: #339933;">=</span><span style="color: #CC0000;">150</span><span style="color: #339933;">;</span> j<span style="color: #339933;">&lt;</span>k<span style="color: #339933;">;</span> j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// the value here doesn't matter.</span>
    obj.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ABCD'</span><span style="color: #339933;">+</span>j<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Sort the array alphabetically.</span>
obj.<span style="color: #660066;">sort</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>m<span style="color: #339933;">,</span>p<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    m<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">+</span>m<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    p<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">+</span>p<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>m <span style="color: #339933;">&gt;</span> p<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>m <span style="color: #339933;">&lt;</span> p<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The <code>obj</code> Array should now be sorted, in alphabetical order based on value.  <strong>BUT, in our best friend Internet Explorer, a <code>Number Expected</code> error may be the result.</strong>  Don&#8217;t be fooled if your test array behaves correctly, it only happens intermittently for arrays of varying size!</p>
<p>So, I <a href="http://www.zachleat.com/test/numberexpected/">whipped up a quick test to check the damage</a>.  Iterating over array sizes from 1 to 150, running the Array sort algorithm.  The following failures resulted:</p>
<table>
<thead>
<tr>
<th>Browser</th>
<th>Failures *</th>
</tr>
</thead>
<tbody>
<tr>
<td>Internet Explorer 6</td>
<td>4 sizes out of 150</td>
</tr>
<tr>
<td>Internet Explorer 7</td>
<td>18 sizes out of 150</td>
</tr>
<tr>
<td>Internet Explorer 8 (and Compatibility Mode)</td>
<td>2 sizes out of 150</td>
</tr>
<tr>
<td>Internet Explorer 9 (and Compatibility Mode)</td>
<td>0 sizes out of 150 (Fixed!)</td>
</tr>
</tbody>
</table>
<p>* Failures may vary to the specifications of the test machine.</p>
<p>Of course, the <code>Number Expected</code> error is going to result whenever your code doesn&#8217;t return a number inside of the function callback.  But the problem here is something deeper than simple application code failure.  The problem is in JScript itself.  Any modification to the sort arguments may result in the <code>Number Expected</code> error.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    m<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">+</span>m<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// modifies the argument m and is unreliable.</span></pre></div></div>

<p>This problem will manifest itself more frequently if you use the Google Closure Compiler, which restructures JavaScript to reuse argument variables if possible, probably to save the 4 character penalty of a &#8220;var &#8221; declaration.</p>
<p>Normally, reusing argument variables is a safe practice for primitives, since they are passed by value and not by reference, as is the case in this Array sort example <sup><a href="#by-ref">1</a></sup>.  So, what exactly is going on here?  One commenter at the <a href="http://code.google.com/p/closure-compiler/issues/detail?id=58">Google Closure Compiler bug</a> seems to think that the actual array values are being passed by reference instead of by value.  I&#8217;m not completely convinced that&#8217;s the case.</p>
<h2>The Fix</h2>
<p><strong>Don&#8217;t reuse the argument variables inside of an Array sort function.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Changing the above example</span>
obj.<span style="color: #660066;">sort</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>m1<span style="color: #339933;">,</span>p1<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> m<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">+</span>m1<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        p<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">+</span>p1<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>m <span style="color: #339933;">&gt;</span> p<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>m <span style="color: #339933;">&lt;</span> p<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><em>Check the <a href="http://www.zachleat.com/test/numberexpected/">source code of the demo file</a> to see the different methods of modifying the arguments that I attempted.</em></p>
<ol>
<li id="by-ref">If you want to learn more about passing by value or reference, <a href="http://snook.ca/archives/javascript/javascript_pass">Jonathan Snook has a nice explanation</a>.</li>
</ol>
<p><em style="font-size: 80%">Internet Explorer can&#8217;t make you do anything, it can only make you wish you hadn&#8217;t.</em></p>
<p><strong>Updated: Added note about Internet Explorer 9 and its Compatibility View. Looks like it&#8217;s fixed!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/array-sort/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Give Up on Internet Explorer Yet</title>
		<link>http://www.zachleat.com/web/dont-give-up-on-ie/</link>
		<comments>http://www.zachleat.com/web/dont-give-up-on-ie/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 03:24:46 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
				<category><![CDATA[Web Browsers]]></category>
		<category><![CDATA[Google Wave]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Zombies]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/?p=351</guid>
		<description><![CDATA[These days, the browser landscape is more fragmented than ever. Were times easier back when IE6 and Firefox ruled the internet? Easier perhaps in terms of the number of browsers you had to launch for testing, but not better for any user&#8217;s experience. We are in a new world, where more web browsers are causing [...]]]></description>
			<content:encoded><![CDATA[<p>These days, the browser landscape is more fragmented than ever.  Were times easier back when IE6 and Firefox ruled the internet? Easier perhaps in terms of the number of browsers you had to launch for testing, but <strong>not better</strong> for any user&#8217;s experience. We are in a new world, where more web browsers are causing developers to become <strong>increasingly pragmatic</strong> with their designs and code. Sure, standards have created a safe haven under the newest versions of the Big 3 (Firefox, IE, Safari), but the lay majority are still using whatever default has been installed onto their computer, and they probably can&#8217;t tell you <a href="http://googlesystem.blogspot.com/2009/06/browser-is-search-engine.html">the difference between their web browser and a search engine</a>.</p>
<p>We must be resilient to resist the transformation from development pragmatism to user abandonment, especially considering a developer&#8217;s trend of being insulated with the latest equipment.  We use the newest hardware and download the most sophisticated browser software because we want the best experiences.  We stack the cards in our favor.  The difficulty lies with the populace that <strong>want a good experience</strong> (they can tell a fast site from a slow site), but they <strong>don&#8217;t want to buy new equipment or install a better browser.</strong>  So the question has become: Where do you place your chips on the spectrum balancing modern hardware/software and the user experience?</p>
<p><img src="http://www.zachleat.com/web/wp-content/uploads/2009/12/zombies.png" alt="zombie" title="zombie" width="200" height="234" class="alignright size-full wp-image-361" />As web developers, it has become increasingly easy to become disenfranchised with the lay majority&#8217;s computing environment.  I&#8217;ve witnessed this personally after purchasing my first Apple computer, a device curiously immune to the plague of IE 6/7 (8 as well, but I would hesitate to label it as a plague, more like a normal run of the mill flesh eating virus).  It&#8217;s an interesting phenomenon, being cutoff from the Windows environment (save virtualization) during development.  It&#8217;s delightfully tempting to declare damnation upon the plague ridden Internet Explorer Zombies, and develop your web presence to standards alone, allowing less focus on the harshest development environment imaginable and more on actual problem solving.</p>
<p>When developers engage in quasi-web development, perhaps in the form of an iPhone specific web application or an Adobe AIR desktop application, it fosters similar feelings.   The work shares many languages and technologies with real (wide-open) web development, but is targeted towards a single web browser.  This benefits of this sort of tunnel vision device targeting must be carefully weighed against the penalties you&#8217;re paying in narrowed default-install client compatibility.  At that point, it&#8217;s just <strong>friends with benefits</strong>.</p>
<p><img src="http://www.zachleat.com/web/wp-content/uploads/2009/12/google-wave-ie8.png" alt="Denial of Access with Internet Explorer Screenshot" title="Denial of Access with Internet Explorer Screenshot" width="454" height="339" class="aligncenter size-full wp-image-363" /><br />
Google Wave, in fact, requires the use of Safari, Firefox, Chrome, or the Google Chrome Frame plugin (which doesn&#8217;t count as actual browser support).  As of the time this article was written, as many as <strong>64% of all users</strong> (<a href="http://en.wikipedia.org/wiki/Usage_share_of_web_browsers">source</a>) are met with the above screen when trying to access Google Wave. Let&#8217;s be clear: <strong>Ease of development is not an excuse to abandon users.</strong>  Whatever happened to <a href="http://www.zachleat.com/web/2009/08/29/device-independence/">Device Independence</a>?</p>
<p>Not surprisingly, Google Wave&#8217;s stand against Internet Explorer <strong>has not started a trend</strong>.  Instead of all out war, the community at large has decided that subtlety is what&#8217;s needed to win this fight.  Let&#8217;s hold back the <a href="http://en.wikipedia.org/wiki/Sexual_Healing">sexual healing</a> of rounded corners, even though perhaps users will call our design harsh or cold.  Let&#8217;s give them plain buttons instead of nice three dimensional buttons with text and box shadows, even though they may be less actionable.</p>
<p>Let&#8217;s make it easier on ourselves at the expense of the user experience of The Zombie Majority.  We make this sacrifice because we assume that Zombies won&#8217;t be able to tell the difference between eating a big juicy Einstein brain and a smaller but nonetheless still tasty brush clearing George W.  And you know what, <strong>I think we&#8217;re right.</strong></p>
<p><em><strong>Updated</strong> to include a few more thoughts on Adobe AIR and the iPhone.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/dont-give-up-on-ie/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Forward Compatibility and JavaScript</title>
		<link>http://www.zachleat.com/web/forward-compatibility-and-javascript/</link>
		<comments>http://www.zachleat.com/web/forward-compatibility-and-javascript/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 01:53:20 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Browsers]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Rendering Modes]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/11/01/forward-compatibility-and-javascript/</guid>
		<description><![CDATA[Many developers (myself included) complain endlessly about the problematic ECMAScript implementation that Internet Explorer uses called JScript. And after reading one such very detailed complaint in the comments on Dave Massy&#8217;s website at MSDN, and reading Chris Wilson&#8217;s post about ECMAScript 3, it has become increasingly obvious of Microsoft&#8217;s opinion on the subject of Forward [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers (myself included) complain endlessly about the problematic ECMAScript implementation that Internet Explorer uses called JScript.  And after reading <a href="http://blogs.msdn.com/dmassy/archive/2006/11/30/vpc-to-run-ie6-and-ie7-on-the-same-machine.aspx">one such very detailed complaint</a> in the comments on Dave Massy&#8217;s website at MSDN, and reading <a href="http://blogs.msdn.com/ie/archive/2007/10/30/ecmascript-3-and-beyond.aspx">Chris Wilson&#8217;s post about ECMAScript 3</a>, it has become increasingly obvious of Microsoft&#8217;s opinion on the subject of Forward Compatibility with JavaScript.  It&#8217;s something they keep pounding their fists on the ground about, how they are adamant that new versions of their browser not &#8220;Break the Web.&#8221;</p>
<p>Of course, &#8220;Breaking the Web&#8221; refers to the amount of code on the internet today that is an equal and opposite reaction to the broken bug-ridden JavaScript implementation of their browser.  It describes the unimaginable future in which Internet Explorer fixed the many well documented <em>intricacies</em> of JScript and thereby ruins the code that was originally written to support the problem.  What a conundrum.</p>
<p>But haven&#8217;t we already been through this problem?  Isn&#8217;t this the same exact thing we saw in the early days of CSS?  And how did the major browser players react?  By implementing both a <a href="http://www.quirksmode.org/css/quirksmode.html">Quirks and Standards mode for CSS through DocType switching</a>.  Now my question is:</p>
<p><strong>Why haven&#8217;t we seen a Quirks and Standards Compatibility Mode for JavaScript?</strong></p>
<p>I&#8217;m not necessarily encouraging the Quirks and Standards modes to be toggled with the DocType (as with CSS), but why not have these two modes?  To enable your site to use the Standards mode of JavaScript, the browser might require a certain DocType to be declared, or it might require a different script type in the browser:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; mode=&quot;standards&quot;&gt;</pre></div></div>

<p>Either that, or <a href="http://dean.edwards.name/weblog/2007/03/yet-another/">I could just use Base2</a>.</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/forward-compatibility-and-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I-Frame Shims or How I Learned to Stop Worrying and Love the Bomb</title>
		<link>http://www.zachleat.com/web/adventures-in-i-frame-shims-or-how-i-learned-to-love-the-bomb/</link>
		<comments>http://www.zachleat.com/web/adventures-in-i-frame-shims-or-how-i-learned-to-love-the-bomb/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 21:51:55 +0000</pubDate>
		<dc:creator>Zach Leatherman</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Browsers]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.zachleat.com/web/2007/04/24/adventures-in-i-frame-shims-or-how-i-learned-to-love-the-bomb/</guid>
		<description><![CDATA[So again, I show up late to the party. IE7 is already out, but my target customers are still using IE6. So today, boys and girls, we&#8217;re going to discover the magical world of using I-Frame shims to hide those bleeding heart select boxes from showing through our layered elements. Typically, when creating an I-Frame [...]]]></description>
			<content:encoded><![CDATA[<p>So again, I show up late to the party.  IE7 is already out, but my target customers are still using IE6.  So today, boys and girls, we&#8217;re going to discover the magical world of using I-Frame shims to hide those bleeding heart select boxes from showing through our layered elements.</p>
<p>Typically, when creating an I-Frame shim, you&#8217;re going to create the i-frame dynamically using document.createElement.  Let&#8217;s start out with some successful code.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> iframeShim <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'iframe'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
iframeShim.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'src'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'javascript:&quot;&quot;;'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
iframeShim.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'frameBorder'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'0'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now for some caveats you might have encountered with code not matching the above:</p>
<p><strong>I-Frame frameBorder attribute</strong><br />
Are you trying to get rid of that nasty i-frame border in Internet Explorer 6 (IE6)?  Tried CSS properties?  Tried setting the frameBorder attribute?  It turns out that when setting the frameBorder attribute, the name of the attribute is case sensitive.  Using frameborder will not work correctly, but using frameBorder (with a capital B) will give the desired result.  [Source: <a href="http://www.visible-form.com/blog/createelement-and-events-and-iframe-borders/">FlashApe</a>]</p>
<p><strong>HTTPS and I-Frame src attribute</strong><br />
Is your page hosted on a secure domain (https instead of just http)?  Is the dynamically created iframe causing the following error message in Internet Explorer?</p>
<p><em>This page contains both secure and nonsecure items.  Do you want to display the nonsecure items?</em></p>
<p>Some have suggested that changing the src attribute to point to a blank html page with no content is the solution, but that&#8217;s an extra http request on your page that is unnecessary.  Others have suggested that that changing the src attribute to javascript:false works.  It does, in fact, but writes the text &#8216;false&#8217; to your iframe content.  Others have suggested javascript:void(0) as your src attribute value [Source: <a href="http://ewbi.blogs.com/develops/2004/07/ie_iframe_and_h.html">ewbi.develops</a>], but some Internet Explorer clients still have secure and nonsecure items alert popup.  I have not figured out the factors that separate these Internet Explorer clients.  </p>
<p><strong>Update</strong>: <del datetime="2008-12-02T05:19:37+00:00">The correct solution is in face setting &#8220;javascript:false;document.write(&#8220;&#8221;);&#8221; as your src value, as I found in the <a href="http://malsup.com/jquery/block/">jQuery BlockUI</a> plugin.  This is a silver bullet fix that will avoid all the problems I have encountered.</del></p>
<p><strong>Update Again</strong>: I have revisited this problem and it looks like (as mentioned in the comments) there is a problem with the solution presented in the first update (infinite load).  After researching some DOMContentLoaded solutions, I thought to try the &#8220;//:&#8221; source they were attempting for their deferred script source.  Alas, it didn&#8217;t work.  However, <code>javascript:"";</code> <strong>does work</strong>, so the above solution has been modified.  Keep in mind, the whole point of this solution is to <strong>avoid</strong> an additional unnecessary HTTP request.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.zachleat.com/web/adventures-in-i-frame-shims-or-how-i-learned-to-love-the-bomb/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

