<?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>IE sucks - Internet Explorer the dumb browser &#187; krishna</title>
	<atom:link href="http://www.iesucks.info/author/jayprakash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iesucks.info</link>
	<description>IE sucks : A campaign to get the dumb IE down</description>
	<lastBuildDate>Sat, 11 Jun 2011 17:49:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Internet Explorer sucks and blows</title>
		<link>http://www.iesucks.info/2009/04/internet-explorer-doesn%e2%80%99t-just-suck-it-also-blows/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=internet-explorer-doesn%25e2%2580%2599t-just-suck-it-also-blows</link>
		<comments>http://www.iesucks.info/2009/04/internet-explorer-doesn%e2%80%99t-just-suck-it-also-blows/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 19:00:40 +0000</pubDate>
		<dc:creator>krishna</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[IE Sucks]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.iesucks.info/?p=110</guid>
		<description><![CDATA[I didn&#8217;t have any particular inclination to be nice to Internet Explorer. And I knew I was going to run into bugs and quirks, none of which would be any different in IE7, because the DOM simply wasn&#8217;t on the development radar for that version. Even so, I&#8217;ve been nothing short of staggered at the]]></description>
			<content:encoded><![CDATA[<p><!-- load needed syntax highlighting brushes --></p>
<p>I didn&#8217;t have any particular inclination to be nice to Internet Explorer. And  I knew I was going to run into bugs and quirks, none of which would be any  different in <abbr title="Internet Explorer 7">IE7</abbr>, because the <abbr title="Document Object Model">DOM</abbr> simply wasn&#8217;t on the development  radar for that version.</p>
<p>Even so, I&#8217;ve been nothing short of staggered at the sheer amount of chaotic  brokenness evident in its implementation of even the simplest of things.</p>
<h2>You wouldn&#8217;t have thought it was so hard</h2>
<p>In addition to qualifying the value of <q>href</q> attributes on links, <abbr title="Internet Explorer">IE</abbr> does the same thing for the <q>src</q> attribute of images.</p>
<p>When retrieving a <q>style</q> attribute, <abbr title="Internet Explorer">IE</abbr> returns a <code>style</code> object, rather than an attribute value. Retrieving  an event-handling attribute such as <q>onclick</q>, it returns the contents of  the event handler wrapped in an anonymous function. Retrieving an attribute  value which evaluates to boolean <code>true</code> (such as <q>disabled</q> or <q>checked</q>, when defined) it returns a boolean, and retrieving a value that  evaluates to a number (such as <q>tabindex</q>), it returns a number. All of  these values are supposed to be returned as strings.</p>
<p>But these attributes are considered by <abbr title="Internet Explorer">IE</abbr> to have non-string values; and so if they&#8217;re not defined at all they return <code>null</code>, rather than an empty string. <abbr title="Internet Explorer"> IE</abbr> also returns <code>null</code> for non-defined attributes it doesn&#8217;t  recognise (<abbr title="that is">ie</abbr>. custom attribute names).</p>
<p>In its defense, other non-defined but known attributes correctly return an  empty string, which is according to specification; and <abbr title="Internet Explorer">IE</abbr> is actually the only browser that does  this (Firefox, Opera and Safari all return <code>null</code>). But that is not  really much of a defense, because it only does that for attributes it recognises, so it isn&#8217;t really implementing to specification, it just happens to be  correct!</p>
<h2>Pure class</h2>
<p>To retrieve a <q>class</q> attribute in Internet Explorer you must refer to  it as <q>className</q>; to retrieve a <q>for</q> attribute you must refer to it  as <q>htmlFor</q>:</p>
<div class="dp-highlighter">
<table id="table1" class="dp-c" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="gutter">1</td>
<td class="line1">//these work in IE, null in others</td>
</tr>
<tr>
<td class="gutter">2</td>
<td class="line2">element.getAttribute(&#8216;className&#8217;);</td>
</tr>
<tr>
<td class="gutter">3</td>
<td class="line1">element.getAttribute(&#8216;htmlFor&#8217;);</td>
</tr>
</tbody>
<thead></thead>
</table>
</div>
<pre style="display: none;"><code>//these work in IE, null in others
element.getAttribute('className');
element.getAttribute('htmlFor');</code></pre>
<p>Now this is a side-effect of the mapping of attributes to <abbr title="HyperText Markup Language">HTML</abbr> <abbr title="Document Object Model">DOM</abbr> properties for example, as a <abbr title="Document Object Model">DOM</abbr> property you always have to refer  to <q>element.className</q> rather than <q>element.class</q>, because <q>class</q> is a reserved word in JavaScript. But while other browsers reconcile this by  allowing string values to <code>getAttribute()</code> to use the original  attribute name, Internet Explorer does not:</p>
<div class="dp-highlighter">
<table id="table2" class="dp-c" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="gutter">1</td>
<td class="line1">//these work in others, null in IE</td>
</tr>
<tr>
<td class="gutter">2</td>
<td class="line2">element.getAttribute(&#8216;class&#8217;);</td>
</tr>
<tr>
<td class="gutter">3</td>
<td class="line1">element.getAttribute(&#8216;for&#8217;);</td>
</tr>
</tbody>
<thead></thead>
</table>
</div>
<pre style="display: none;"><code>//these work in others, null in IE
element.getAttribute('class');
element.getAttribute('for');</code></pre>
<p>And there are other attributes that can only be referred to by the  camel-cased name they use for their <abbr title="Document Object Model">DOM</abbr> property equivalent, even though those names are not reserved words; I haven&#8217;t  found a concrete pattern, but examples of this are <q>tabIndex</q> and <q> accessKey</q>.</p>
<h2>And there&#8217;s more</h2>
<p>Internet Explorer implements a second, proprietary argument to <code> getAttribute()</code>, which is supposed to control the way it behaves. The  second argument is a numerical flag which can take the value <code>0</code>, <code>1</code> or <code>2</code>. According to MSDN:</p>
<ul>
<li><code>0</code> (default): Performs a property search that is not  	case-sensitive, and returns an interpolated value if the property is found.</li>
<li><code>1</code>: Performs a case-sensitive property search.</li>
<li><code>2</code>: Returns the value exactly as it was set in script or in  	the source document.</li>
</ul>
<p>When it says <q>interpolated value</q> it means it won&#8217;t necessarily return a  string, as already noted. Notice also how it says <q>if the <strong>property</strong> is  found</q> [my emphasis] this would seem to imply that <abbr title="Internet Explorer">IE</abbr> is not using <code>getAttribute()</code> as a getter for node values at all, itâ€™s using it as a getter for <abbr title="Document Object Model">DOM</abbr> properties! If true, this goes a  long way to explaining its aberrant behavior  if its retrieving property  values, thats why it requires property names, and why it returns a value of the  applicable type; and when <abbr title="Microsoft Developer Network">MSDN</abbr> says that <code>getAttribute()</code> <q>retrieves the value of the specified  attribute</q>, it is flat-out lying.</p>
<p>The difference between <code>0</code> and <code>1</code> appears to be  implemented as documented attribute names are treated as case-sensitive, so a  search for <q>onClick</q> will not match <q>onclick</q>.</p>
<p>However the value <code>2</code> does not behave as documented. When this  value is used, event-handling attributes are still returned as functions, the <q> style</q> attribute is an empty string, and values which evaluate to boolean <code>true</code> return <code>65535</code> (which is <code>2<sup>16</sup></code>,  the largest possible value of a 16-bit number. What&#8217;s up with that??) But hey on a more positive note <q>href</q> and <q>src</q> attributes do return their  literal value, rather than a qualified <abbr title="Uniform Resource Locator"> URI</abbr>. I suppose we should be grateful for small mercies!</p>
<p>You can see why I said it&#8217;s eating my brain, I mean failing so  comprehensively to implement the standards is one thing, and bad enough, but  Internet Explorer <strong>doesn&#8217;t even implement its own proprietary stuff correctly!</strong></p>
<p><span style="color: #ff9900;">article source: <a href="http://www.sitepoint.com" target="_blank">www.sitepoint.com</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iesucks.info/2009/04/internet-explorer-doesn%e2%80%99t-just-suck-it-also-blows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

