<?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>samuli.hakoniemi.net &#187; failed</title>
	<atom:link href="http://samuli.hakoniemi.net/tag/failed/feed/" rel="self" type="application/rss+xml" />
	<link>http://samuli.hakoniemi.net</link>
	<description></description>
	<lastBuildDate>Thu, 20 Oct 2011 10:03:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<atom:link rel='hub' href='http://samuli.hakoniemi.net/?pushpress=hub'/>
		<item>
		<title>When jQuery returns &#8220;failed&#8221; in IE &#8211; and how it&#8217;s probably resolved</title>
		<link>http://samuli.hakoniemi.net/when-jquery-returns-failed-in-ie-and-how-its-probably-resolved/</link>
		<comments>http://samuli.hakoniemi.net/when-jquery-returns-failed-in-ie-and-how-its-probably-resolved/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 22:21:16 +0000</pubDate>
		<dc:creator>Samuli Hakoniemi</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[failed]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[internetexplorer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://samuli.hakoniemi.net/?p=253</guid>
		<description><![CDATA[In web development, I love facing unexpected problems I haven't seen before. It's an excellent situation to learn new things. And the moment right after I've found a solution - it's a perfect moment.

But when I can't find a solution, no matter how hard I try, and especially when I can't find anything from Google that could help me.. well, I get very frustrated.

In this brief article, I'll go through one problematic situation that really got me frustrated. Plus, this hopefully can be found via Google and therefore works as a solution to anyone who's facing a same problem.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsamuli.hakoniemi.net%2Fwhen-jquery-returns-failed-in-ie-and-how-its-probably-resolved%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsamuli.hakoniemi.net%2Fwhen-jquery-returns-failed-in-ie-and-how-its-probably-resolved%2F&amp;source=zvona&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="img_main" src="http://samuli.hakoniemi.net/wp-content/images/debugging-testing-ie/debugging-testing-ie.jpg" alt="When jQuery returns failed in IE - and how it's probably resolved" /></p>
<div class="ingress">In web development, I love facing unexpected problems I haven&#8217;t seen before. It&#8217;s an excellent situation to learn new things. And the moment right after I&#8217;ve found a solution &#8211; it&#8217;s a perfect moment.</p>
<p>But when I can&#8217;t find a solution, no matter how hard I try, and especially when I can&#8217;t find anything from Google that could help me.. well, I get very frustrated.</p>
<p>In this brief article, I&#8217;ll go through one problematic situation that really got me frustrated. Plus, this hopefully can be found via Google and therefore works as a solution to anyone who&#8217;s facing a same problem.</p></div>
<p>Last week at work, I encountered a very peculiar problem in Internet Explorer. There were several IE-related bugs reported in a certain part of the service. However, I couldn&#8217;t reproduce them and I expected these bugs had been fixed during other updates in the code..</p>
<p>..until it suddenly happened. All the tested versions of IE&#8217;s (6, 7, 8) started reporting either error &#8220;failed&#8221; or &#8220;unexpected error&#8221;, pointing to jQuery&#8217;s code. And there worst part was that error occurred occasionally, although nothing was changed.</p>
<p>In this case, there&#8217;s jQuery 1.3.2 in use. Error message didn&#8217;t help and the line it was pointing to, belonged to a internal / helper function into jQuery.</p>
<p>At first, errors disappeared after some fixes I expected to resolve the situation. But, like I mentioned earlier: these errors were occasional.</p>
<p>I didn&#8217;t have anything that could have helped me at least a little on tracking this problem (later I found not even unit tests would&#8217;ve solved this &#8211; although it&#8217;s not an argument why I didn&#8217;t have unit testing for javascript). So, my only choice was trying to isolate the problem function by function, line by line.</p>
<p>Ultimately I found that all the errors were caused by event handler bindings made with function $.fn.live(). I couldn&#8217;t blame the selectors being too unprecise, although I reduced the amount of troublemakers by fine-tuning them. In addition, I found that wrapping them in setTimeout() with small delay would have possibly fixed the problem. Also, IE6 had the most problems, while IE7 started to feel stable.</p>
<p>Most likely there was something going on with perfomance. However, after all this I wasn&#8217;t in a mood to expect these problems were completely solved. So I ended up binding event handlers with $.fn.bind() whenever something was dynamically added. It meant more lines of code, but it also meant that no errors were occurred ever again.</p>
<p>The point of this article can be put in one sentence: <b>if you receive an error with message &#8220;failed&#8221; or &#8220;unexpected error&#8221; from jQuery and this happens only in Internet Explorer, comment out every possible live() binding and try again</b>.</p>
]]></content:encoded>
			<wfw:commentRss>http://samuli.hakoniemi.net/when-jquery-returns-failed-in-ie-and-how-its-probably-resolved/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

