<?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>Mon, 28 Jun 2010 08:14:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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/</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’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’t on the development  radar for that version.
Even so, I’ve been nothing short of staggered [...]]]></description>
			<content:encoded><![CDATA[<p><!-- load needed syntax highlighting brushes --></p>
<p>I didn’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’t on the development  radar for that version.</p>
<p>Even so, I’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’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’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’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’s not  really much of a defense, because it only does that for attributes it recognises  — so it isn’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(&#8217;className&#8217;);</td>
</tr>
<tr>
<td class="gutter">3</td>
<td class="line1">element.getAttribute(&#8217;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(&#8217;class&#8217;);</td>
</tr>
<tr>
<td class="gutter">3</td>
<td class="line1">element.getAttribute(&#8217;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’t  found a concrete pattern, but examples of this are <q>tabIndex</q> and <q> accessKey</q>.</p>
<h2>And there’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’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 it’s retrieving property  values, that’s 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’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’s eating my brain … I mean, failing so  comprehensively to implement the standards is one thing, and bad enough, but  Internet Explorer <strong>doesn’t even implement its own proprietary stuff correctly!</strong></p>
<p><span style="color: #ff9900;">article source: www.sitepoint.com</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>1</slash:comments>
		</item>
	</channel>
</rss>
