<?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>DaveOnCode &#187; internet explorer</title>
	<atom:link href="http://www.daveoncode.com/tag/internet-explorer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.daveoncode.com</link>
	<description>Objective C, iOS and more programming stuff</description>
	<lastBuildDate>Mon, 19 Dec 2011 12:11:12 +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>Using getAttribute() to retrieve the label&#8217;s &quot;for&quot; attribute returns NULL on internet explorer!</title>
		<link>http://www.daveoncode.com/2008/12/12/using-getattribute-to-retrieve-the-labels-for-attribute-returns-null-on-internet-explorer/</link>
		<comments>http://www.daveoncode.com/2008/12/12/using-getattribute-to-retrieve-the-labels-for-attribute-returns-null-on-internet-explorer/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 15:40:47 +0000</pubDate>
		<dc:creator>Davide Zanotti</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[browser incopatibility]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[crossbrowser]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://daveoncode.wordpress.com/?p=136</guid>
		<description><![CDATA[Damned Internet Explorer!!! I&#8217;ve just faced another browser issue by using the javascript function getAttribute() in order to retrieve the &#8220;for&#8221; value of a form&#8217;s label, ie: myLabel.getAttribute("for"); (where &#8220;myLabel&#8221; is a reference to a &#60;label&#62; node) The function always returns NULL, even if the &#8220;for&#8221; attribute is manually specified into HTML code, ie: &#60;label [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.daveoncode.com/2008/12/12/using-getattribute-to-retrieve-the-labels-for-attribute-returns-null-on-internet-explorer/' addthis:title='Using getAttribute() to retrieve the label&#8217;s &#34;for&#34; attribute returns NULL on internet explorer! ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Damned Internet Explorer!!! I&#8217;ve just faced another browser issue by using the javascript function <em><strong>getAttribute()</strong></em> in order to retrieve the &#8220;for&#8221; value of a form&#8217;s label, ie:</p>
<pre>
myLabel.getAttribute("for");
</pre>
<p>(where &#8220;myLabel&#8221; is a reference to a &lt;label&gt; node)<br />
The function always returns NULL, even if the &#8220;for&#8221; attribute is manually specified into HTML code, ie:</p>
<pre>
&lt;label for="my_field_id"&gt;my label&lt;/label&gt;
</pre>
<p>Fortunately, after a brief search on Google, I&#8217;ve found a post on quirksmode.org, which contains a comment by Tino Zijdel, that show an easy and crossbrowser solution to get the &#8220;for&#8221; attribute (that can be used both to set a value or to get it):</p>
<pre>
myLabel.htmlFor
</pre>
<p>Thank you Tino!</p>
<p>In my search I&#8217;d even discovered that on Internet Explorer <strong><em>getAttribute()</em></strong> is different from other browsers, because it offers an extra argument called &#8220;iFlags&#8221; that is a number that can be 0, 1 or 2 (genial!) and means (I&#8217;m reporting the official microsoft documentation):</p>
<p>0 -&gt; Default. Performs a property search that is not case-sensitive, and returns an interpolated value if the property is found<br />
1 -&gt; Performs a case-sensitive property search. To find a match, the uppercase and lowercase letters in AttributeName  must exactly match those in the attribute name. If the iFlags  parameter for getAttribute is set to 1 and this option is set to 0 (default), the specified property name might not be found.<br />
2 -&gt; Returns the value exactly as it was set in script or in the source document</p>
<p>It would be a better world without Internet Explorer!</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.daveoncode.com/2008/12/12/using-getattribute-to-retrieve-the-labels-for-attribute-returns-null-on-internet-explorer/' addthis:title='Using getAttribute() to retrieve the label&#8217;s &quot;for&quot; attribute returns NULL on internet explorer! ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.daveoncode.com/2008/12/12/using-getattribute-to-retrieve-the-labels-for-attribute-returns-null-on-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoid CSS hacks for internet explorer 6 (ie6) by using selectors</title>
		<link>http://www.daveoncode.com/2008/12/02/avoid-css-hacks-for-internet-explorer-6-ie6-by-using-selectors/</link>
		<comments>http://www.daveoncode.com/2008/12/02/avoid-css-hacks-for-internet-explorer-6-ie6-by-using-selectors/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 15:28:27 +0000</pubDate>
		<dc:creator>Davide Zanotti</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[conditional css]]></category>
		<category><![CDATA[css hacks]]></category>
		<category><![CDATA[css selectors]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://daveoncode.wordpress.com/?p=92</guid>
		<description><![CDATA[Is a common practice to use CSS hacks in order to assign specif stylesheet to internet explorer 6, like: &#60;!--[if IE6]&#62; &#60;link rel="stylesheet" type="text/css" href="ie6fix.css" /&#62; &#60;![endif]--&#62; However we can avoid extra CSS files (for internet explorer 6) by assign first all the necessary properties for it, an then reassign them for others modern browsers [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.daveoncode.com/2008/12/02/avoid-css-hacks-for-internet-explorer-6-ie6-by-using-selectors/' addthis:title='Avoid CSS hacks for internet explorer 6 (ie6) by using selectors ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Is a common practice to use CSS hacks in order to assign specif stylesheet to internet explorer 6, like:</p>
<pre>
&lt;!--[if IE6]&gt;
    &lt;link rel="stylesheet" type="text/css" href="ie6fix.css" /&gt;
&lt;![endif]--&gt;
</pre>
<p>However we can avoid extra CSS files (for internet explorer 6) by assign first all the necessary properties for it, an then reassign them for others modern browsers (firefox, safari, opera and ie7) . For example:</p>
<pre>
div.mydiv {
    padding: 5px;
    position: absolute;
    top: 5px; /* this should be 3px except ie6 */
    right: 10px; /* this should be 7px except ie6 */
}

/*
redefine the properties for all browser that
support CSS selectors (not ie6!)
*/
div[class~="mydiv"] {
    top: 3px;
    right: 7px;
}
</pre>
<p>It&#8217;s important to notice that we should use the &#8220;contains&#8221; selector (~=), in order to work even if the div into the page as several CSS classes applied (like &lt;div class=&#8221;mydiv customer_info&#8221;&gt;).</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.daveoncode.com/2008/12/02/avoid-css-hacks-for-internet-explorer-6-ie6-by-using-selectors/' addthis:title='Avoid CSS hacks for internet explorer 6 (ie6) by using selectors ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.daveoncode.com/2008/12/02/avoid-css-hacks-for-internet-explorer-6-ie6-by-using-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View the generated source code in internet explorer with a bookmarklet</title>
		<link>http://www.daveoncode.com/2008/11/24/view-the-generated-source-code-in-internet-explorer-with-a-bookmarklet/</link>
		<comments>http://www.daveoncode.com/2008/11/24/view-the-generated-source-code-in-internet-explorer-with-a-bookmarklet/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 16:36:42 +0000</pubDate>
		<dc:creator>Davide Zanotti</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://daveoncode.wordpress.com/?p=70</guid>
		<description><![CDATA[As all knows, in browser like Firefox, in order to view the generated source code of a page (that is the final HTML which the browser display into the window, so it includes JS generated nodes and SSI inclusions) we have simply to select all (ctr+A or command+A on a Mac) and choose &#8220;View selection [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.daveoncode.com/2008/11/24/view-the-generated-source-code-in-internet-explorer-with-a-bookmarklet/' addthis:title='View the generated source code in internet explorer with a bookmarklet ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-71" title="internet explorer sucks" src="http://www.daveoncode.com/wp-content/uploads/2008/11/internet-explorer-logo-with-pins.jpg" alt="internet explorer sucks" width="204" height="176" />As all knows, in browser like Firefox, in order to view the generated source code of a page (that is the final HTML which the browser display into the window, so it includes JS generated nodes and SSI inclusions) we have simply to select all (ctr+A or command+A on a Mac) and choose &#8220;View selection source&#8221;. Internet Explorer instead doesn&#8217;t offers the ability to view the generated source but only the basic HTML code (whic doesn&#8217;t include dynamic generated content). To have such feature, I&#8217;ve used the <strong><em>innerHTML</em></strong> property to get the final content of <em><strong>&lt;html&gt;</strong></em> tag, and I&#8217;ve realized a bookmarklet to call after the loading of the page. The bookmarklet opens an 800&#215;600 resizable popup with a textarea that shows the HTML code.</p>
<p>This is the code of the bookmarklet:</p>
<div class="codecolorer-container html4strict mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">javascript:var p=window.open(&quot;&quot;,&quot;p&quot;,&quot;width=800,height=600,resizable=yes&quot;);p.document.open();p.document.write('<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">textarea</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width:100%;height=100%'&quot;</span>&gt;</span>'+document.getElementsByTagName(&quot;html&quot;)[0].innerHTML+'<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span>');p.document.close();void(0);</div></td></tr></tbody></table></div>
<p>to use it, simply copy and paste into the ie address bar and press enter ;-)</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.daveoncode.com/2008/11/24/view-the-generated-source-code-in-internet-explorer-with-a-bookmarklet/' addthis:title='View the generated source code in internet explorer with a bookmarklet ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.daveoncode.com/2008/11/24/view-the-generated-source-code-in-internet-explorer-with-a-bookmarklet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

