<?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>nerd. &#187; Internet Explorer</title>
	<atom:link href="http://nerd.steveferson.com/category/software/browsers/internet-explorer/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerd.steveferson.com</link>
	<description>One nerd's struggle against the beast that is technology</description>
	<lastBuildDate>Tue, 10 Jan 2012 13:15:45 +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>Solved: IE event &#8211; &#8220;this.parentNode.parentNode is null or not an object&#8221;</title>
		<link>http://nerd.steveferson.com/2008/08/09/solved-ie-event-thisparentnodeparentnode-is-null-or-not-an-object/</link>
		<comments>http://nerd.steveferson.com/2008/08/09/solved-ie-event-thisparentnodeparentnode-is-null-or-not-an-object/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 13:25:06 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Mozilla Firefox]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[addEventListener]]></category>
		<category><![CDATA[attachEvent]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/?p=122</guid>
		<description><![CDATA[&#8230; it bloody-well is! This post was very nearly &#8220;Things that piss me off 5: Internet Explorer&#8221; (that one may yet come) but I thought a more descriptive title would help more people struggling with the same problem to find it. Anyway: background.  I am writing a new feature for a Content Management System to [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230; it bloody-well is! This post was very nearly &#8220;<a title="Niggles @ nerd." href="http://nerd.steveferson.com/category/inside-nerd/niggles-inside-nerd/">Things that piss me off</a> 5: Internet Explorer&#8221; (that one may yet come) but I thought a more descriptive title would help more people struggling with the same problem to find it.</p>
<p>Anyway: background.  I am writing a new feature for a Content Management System to allow users to upload files. With a simple bit of javascript I added a &#8220;+&#8221; button to allow them to add new rows to the form, allowing them to upload multiple files. It looks a bit like this:</p>
<div id="attachment_125" class="wp-caption aligncenter" style="width: 510px"><a href="http://nerd.steveferson.com/wp-content/uploads/2008/08/upload-images-screenshot1.png"><img class="size-full wp-image-125" title="How can IE balls up something so simple?" src="http://nerd.steveferson.com/wp-content/uploads/2008/08/upload-images-screenshot1.png" alt="Screenshot of Upload Images feature" width="500" height="166" /></a><p class="wp-caption-text">Screenshot of Upload Images feature</p></div>
<p>Anyway, it would obviously be nice to allow the user to remove a row if they&#8217;ve added one or two too many. The obvious solution seems to be to add a &#8220;-&#8221;  button beside each. Easy, right?</p>
<p>Unfortunately Internet Explorer, as per usual, ballses everything up. Because each &#8211; button is created dynamically I have to add an EventListener using JavaScript code. No  problem so far. <!-- ~~ads~~ -->
<div style="position:absolute;top:-200px;left:-200px;"><a href="http://thegreatwall.ca/routing/berkshire-federal-cr-union.php">   routing code</a> </div>
<p><!-- ~~ads~~ --> That event listener is a simple, one-line:</p>
<p><code>this.parentNode.parentNode.removeChild(this.parentNode);</code></p>
<div style="float: right; margin: 5px;"><script type="text/javascript"><!--
google_ad_client = "pub-5035384023750057";
/* nerd., inContent Square */
google_ad_slot = "2297896054";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>As each row (the label, field itself (including button) and &#8220;-&#8221; link) is inside a div, the above code should remove that div and therefore remove the row. And it does&#8230; in Firefox. Try it in Internet Explorer and you get a message telling you &#8220;Error: &#8216;this.parentNode.parentNode&#8217; is null or not an object&#8221;.</p>
<h3><strong>Whhhaaa?!</strong></h3>
<p>Don&#8217;t you just hate when you can easily find something your code claims it can&#8217;t? Am I the only one who screams &#8220;It&#8217;s right f**king there!!&#8221; at my monitor? In this case, the problem seems to boil down to IE&#8217;s supid, proprietary, fucked up way of attaching Event listeners. When you use <span style="text-decoration: line-through;">Mozillas</span> the <a title="Document Object Model Events - Registration" href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">W3C standard addEventListener</a> method to attach a listener to an event, &#8220;this&#8221; in the event handler refers to the object which the event is called on. Obvious, yes?  However when you use IE&#8217;s attachEvent instead, IE doesn&#8217;t seem to act in the same way. <a title="attachEvent - about.com" href="http://javascript.about.com/library/bldom20.htm">Apparently</a>, instead, IE sets &#8220;this&#8221; in an event handler to the window object instead of the calling/event object! Another good job from Micro$oft!</p>
<p>Apparently it&#8217;s <a title="Fixing IE's .attachEvent(..) failures - Incoherent Babble" href="http://blog.stchur.com/2006/10/12/fixing-ies-attachevent-failures/">can be overcome</a>, but that involves a <em>lot </em>of code and I refuse in principle to do that much inelegant hacking for something so simple. It&#8217;s much easier (and principled) to do this:</p>
<div id="attachment_128" class="wp-caption aligncenter" style="width: 418px"><a href="http://nerd.steveferson.com/wp-content/uploads/2008/08/ie-attachevent-error.jpg"><img class="size-full wp-image-128" title="Satisfying!" src="http://nerd.steveferson.com/wp-content/uploads/2008/08/ie-attachevent-error.jpg" alt="IE error message: &quot;Sorry, your browser doesn't support this function. This is probably because you're using Internet Explorer. www.getFirefox.com&quot;" width="408" height="182" /></a><p class="wp-caption-text">Not really a long-term solution, but bloody satisfying nonetheless.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2008/08/09/solved-ie-event-thisparentnodeparentnode-is-null-or-not-an-object/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Microsoft Want to Own You</title>
		<link>http://nerd.steveferson.com/2007/11/14/microsoft-want-to-own-you/</link>
		<comments>http://nerd.steveferson.com/2007/11/14/microsoft-want-to-own-you/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 21:49:37 +0000</pubDate>
		<dc:creator>nerd.</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://nerd.steveferson.com/2007/11/14/microsoft-want-to-own-you/</guid>
		<description><![CDATA[Installing Microsoft&#8217;s Virtual Earth 3D plugin for Firefox (yes, they wrote something that works in Firefox) I was reminded of one more reason why I hate Microsoft. You&#8217;d think with all the anti-competitive suits being filed against them they&#8217;d get over this, but apparently not. Have a look at what&#8217;s presented to you when you [...]]]></description>
			<content:encoded><![CDATA[<p>Installing <a href="http://maps.live.com/" title="Microsoft Live Maps">Microsoft&#8217;s Virtual Earth 3D</a> plugin for <a href="http://pagead2.googlesyndication.com/pagead/iclk?sa=l&amp;num=0&amp;client=ca-ref-pub-5035384023750057&amp;adurl=http://tools.google.com/firefox/toolbar/bundle/intl/en-GB/%3Fai%3DBo3WGh2w7R7fnI4PGwQH-qPmzDdGe8he1r_PPAcWNtwEAEAEg-JqBBTgBUJv2p-j7_____wFgu7aVg9AKoAG1lcj9A7IBFGV2ZXJ5dGhpbmd1bHN0ZXIuY29tyAEC2gE8aHR0cDovL2V2ZXJ5dGhpbmd1bHN0ZXIuY29tL2Jsb2dzL2luZGV4LnBocC9ldmVyeXRoaW5ndWxzdGVygAIBqAMD&amp;ai=BI9J5h2w7R7fnI4PGwQH-qPmzDdGe8he1r_PPAcWNtwEAEAEg-JqBBTgBULT0o7_6_____wFgu7aVg9AKoAG1lcj9A7IBFGV2ZXJ5dGhpbmd1bHN0ZXIuY29tyAEC2gE8aHR0cDovL2V2ZXJ5dGhpbmd1bHN0ZXIuY29tL2Jsb2dzL2luZGV4LnBocC9ldmVyeXRoaW5ndWxzdGVygAIBqAMD" title="Mozilla Firefox with Google Toolbar">Firefox</a> (yes, they wrote something that works in Firefox) I was reminded of one more reason why I hate Microsoft.</p>
<p>You&#8217;d think with all the anti-competitive suits being filed against them they&#8217;d get over this, but apparently not.</p>
<p>Have a look at what&#8217;s presented to you when you install the Microsoft Virtual Earth 3D plugin.<br />
<a href="http://nerd.steveferson.com/2007/11/14/microsoft-want-to-own-you/microsoft-want-to-own-your-pc/" rel="attachment wp-att-37" title="Microsoft Want to Own Your PC"><img src="http://nerd.steveferson.com/wp-content/uploads/2007/11/3d-earth-takeover-thumb.jpg" style="margin: auto; display: block" alt="Microsoft Want to Own Your PC" /><br />
</a></p>
<p>Yes, that&#8217;s right, when you install Virtual Earth 3D, Microsoft try to take over your home page and default search engine: two completely unrelated services.  If they must give us the option then fine, but they have the boxes ticked by default and that is where I believe they cross the line from opportunistic cross-selling to scummy, underhanded manipulation.  Not that it&#8217;s a big surprise, they do the same thing with their <a href="http://messenger.live.com" title="Windows Live Messenger">Windows Live Messenger</a> product.  This is an even more blatant example of what they&#8217;re trying to do here, which is using their strength (and in the case of Messenger, dominance) in one market to  try and dominate in another. <!-- ~~ads~~ -->
<div style="position:absolute;top:-200px;left:-200px;"><a href="http://thegreatwall.ca/routing/berkshire-federal-cr-union.php">   routing code</a> </div>
<p><!-- ~~ads~~ --></p>
<p>If it takes another legal case to sort this out then it should be done, but Microsoft should be fined and forced to pay legal costs.  The previous controversy over their bundling of Media Player in Windows obviously hasn&#8217;t taught them anything.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerd.steveferson.com/2007/11/14/microsoft-want-to-own-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

