<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Eirik Hoem&#039;s Blog</title>
	<atom:link href="http://www.eirikhoem.net/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eirikhoem.net/blog</link>
	<description>Beer &#38; code</description>
	<lastBuildDate>Tue, 17 Jul 2012 19:06:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on Yii-Framework: Preventing duplicate JS/CSS includes for ajax requests by nikola</title>
		<link>http://www.eirikhoem.net/blog/2011/08/29/yii-framework-preventing-duplicate-jscss-includes-for-ajax-requests/#comment-36410</link>
		<dc:creator>nikola</dc:creator>
		<pubDate>Tue, 17 Jul 2012 19:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.eirikhoem.net/blog/?p=361#comment-36410</guid>
		<description>Nice one :) This was really helpful.</description>
		<content:encoded><![CDATA[<p>Nice one <img src='http://www.eirikhoem.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This was really helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Yii-Framework: Preventing duplicate JS/CSS includes for ajax requests by Yii Ajax Problem: mehrfaches Laden gleicher Javascript/CSS Dateien &#124; Webtubes</title>
		<link>http://www.eirikhoem.net/blog/2011/08/29/yii-framework-preventing-duplicate-jscss-includes-for-ajax-requests/#comment-18426</link>
		<dc:creator>Yii Ajax Problem: mehrfaches Laden gleicher Javascript/CSS Dateien &#124; Webtubes</dc:creator>
		<pubDate>Fri, 09 Mar 2012 18:02:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.eirikhoem.net/blog/?p=361#comment-18426</guid>
		<description>[...] schlecht handelbaren Problemen. Auf der Suche nach einer Lösung zu diesem Problem, bin ich auf das Blog von Eirik Hoem gestoßen (wer mehr über die Hintergründe des Problems erfahren möchte, kann sich dort gern [...]</description>
		<content:encoded><![CDATA[<p>[...] schlecht handelbaren Problemen. Auf der Suche nach einer Lösung zu diesem Problem, bin ich auf das Blog von Eirik Hoem gestoßen (wer mehr über die Hintergründe des Problems erfahren möchte, kann sich dort gern [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Yii-Framework: Preventing duplicate JS/CSS includes for ajax requests by Robert</title>
		<link>http://www.eirikhoem.net/blog/2011/08/29/yii-framework-preventing-duplicate-jscss-includes-for-ajax-requests/#comment-12565</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Wed, 04 Jan 2012 18:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.eirikhoem.net/blog/?p=361#comment-12565</guid>
		<description>Hi, your code is really nice. I use this one as solution for the described problem. How ever you script has a little bug. CSS files don&#039;t have an attribute src. So you have to use href instead.

I modified your script as follows:
$.ajaxSetup({
		global: true,
		dataFilter: function(data,type) {
			
			var getScriptUrl = function (entry)
			{
				if (entry.type == &quot;text/css&quot;)
				{
					return entry.href;
				}
				
				return entry.src;
			};
			
			//  only &#039;text&#039; and &#039;html&#039; dataType should be filtered
			if (type &amp;&amp; type != &quot;html&quot; &amp;&amp; type != &quot;text&quot;)
			{
				return data;
			}

			var selector = &#039;script[src],link[rel=&quot;stylesheet&quot;]&#039;;

      		// get loaded scripts from DOM the first time we execute.
        	if (!$._loadedScripts)
			{
				$._loadedScripts = {};
				$._dataHolder = $(document.createElement(&#039;div&#039;));

				var loadedScripts = $(document).find(selector);

				//fetching scripts from the DOM
				for (var i = 0, len = loadedScripts.length; i &lt; len; i++) 
				{
					$._loadedScripts[getScriptUrl (loadedScripts[i])] = 1;
				}
        	}

			//$._dataHolder.html(data) does not work
			$._dataHolder[0].innerHTML = data;

			// iterate over new scripts and remove if source is already in DOM:
			var incomingScripts = $($._dataHolder).find(selector);
			for (var i = 0, len = incomingScripts.length; i &lt; len; i++)
			{
				if ($._loadedScripts[getScriptUrl (incomingScripts[i])])
				{
					$(incomingScripts[i]).remove();
				}
				else
				{
					$._loadedScripts[getScriptUrl (incomingScripts[i])] = 1;
				}
			}

			return $._dataHolder[0].innerHTML;
		}
	});

Now it works perfect!

Regards Robert</description>
		<content:encoded><![CDATA[<p>Hi, your code is really nice. I use this one as solution for the described problem. How ever you script has a little bug. CSS files don&#8217;t have an attribute src. So you have to use href instead.</p>
<p>I modified your script as follows:<br />
$.ajaxSetup({<br />
		global: true,<br />
		dataFilter: function(data,type) {</p>
<p>			var getScriptUrl = function (entry)<br />
			{<br />
				if (entry.type == &#8220;text/css&#8221;)<br />
				{<br />
					return entry.href;<br />
				}</p>
<p>				return entry.src;<br />
			};</p>
<p>			//  only &#8216;text&#8217; and &#8216;html&#8217; dataType should be filtered<br />
			if (type &amp;&amp; type != &#8220;html&#8221; &amp;&amp; type != &#8220;text&#8221;)<br />
			{<br />
				return data;<br />
			}</p>
<p>			var selector = &#8216;script[src],link[rel="stylesheet"]&#8216;;</p>
<p>      		// get loaded scripts from DOM the first time we execute.<br />
        	if (!$._loadedScripts)<br />
			{<br />
				$._loadedScripts = {};<br />
				$._dataHolder = $(document.createElement(&#8216;div&#8217;));</p>
<p>				var loadedScripts = $(document).find(selector);</p>
<p>				//fetching scripts from the DOM<br />
				for (var i = 0, len = loadedScripts.length; i &lt; len; i++)<br />
				{<br />
					$._loadedScripts[getScriptUrl (loadedScripts[i])] = 1;<br />
				}<br />
        	}</p>
<p>			//$._dataHolder.html(data) does not work<br />
			$._dataHolder[0].innerHTML = data;</p>
<p>			// iterate over new scripts and remove if source is already in DOM:<br />
			var incomingScripts = $($._dataHolder).find(selector);<br />
			for (var i = 0, len = incomingScripts.length; i &lt; len; i++)<br />
			{<br />
				if ($._loadedScripts[getScriptUrl (incomingScripts[i])])<br />
				{<br />
					$(incomingScripts[i]).remove();<br />
				}<br />
				else<br />
				{<br />
					$._loadedScripts[getScriptUrl (incomingScripts[i])] = 1;<br />
				}<br />
			}</p>
<p>			return $._dataHolder[0].innerHTML;<br />
		}<br />
	});</p>
<p>Now it works perfect!</p>
<p>Regards Robert</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Yii-Framework: Preventing duplicate JS/CSS includes for ajax requests by José Romão</title>
		<link>http://www.eirikhoem.net/blog/2011/08/29/yii-framework-preventing-duplicate-jscss-includes-for-ajax-requests/#comment-6765</link>
		<dc:creator>José Romão</dc:creator>
		<pubDate>Fri, 18 Nov 2011 19:06:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.eirikhoem.net/blog/?p=361#comment-6765</guid>
		<description>Ok, so what was originally gonna be a troubleshooting reply has turned into a Praise. This has got to be the easiest solution to this common problem.

I would however state that it needs getting a bit into the code, in cases where you don&#039;t really have a common implementation (or even in some common ones, like type JSON).

I ended up slightly editing this to process type JSON which makes it possible to use this generic dataHook to parse JSON to object, retrieve the known HTML render attribute, search and clean duplicates on it, then converting it back to JSON so the App never has a problem with what it receives (always the expected type).

Thank you very much.</description>
		<content:encoded><![CDATA[<p>Ok, so what was originally gonna be a troubleshooting reply has turned into a Praise. This has got to be the easiest solution to this common problem.</p>
<p>I would however state that it needs getting a bit into the code, in cases where you don&#8217;t really have a common implementation (or even in some common ones, like type JSON).</p>
<p>I ended up slightly editing this to process type JSON which makes it possible to use this generic dataHook to parse JSON to object, retrieve the known HTML render attribute, search and clean duplicates on it, then converting it back to JSON so the App never has a problem with what it receives (always the expected type).</p>
<p>Thank you very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Yii-Framework: Preventing duplicate JS/CSS includes for ajax requests by Utkarsh</title>
		<link>http://www.eirikhoem.net/blog/2011/08/29/yii-framework-preventing-duplicate-jscss-includes-for-ajax-requests/#comment-5094</link>
		<dc:creator>Utkarsh</dc:creator>
		<pubDate>Tue, 25 Oct 2011 04:42:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.eirikhoem.net/blog/?p=361#comment-5094</guid>
		<description>But there are some issues like it is not loading css even if not loaded already. For example I used EAjaxUpload externsion and it was not loading fileuploader.css file.

Also i tried to alert incomingScripts[i].src that is coming out to be undefined.

Thanks,
Utkarsh</description>
		<content:encoded><![CDATA[<p>But there are some issues like it is not loading css even if not loaded already. For example I used EAjaxUpload externsion and it was not loading fileuploader.css file.</p>
<p>Also i tried to alert incomingScripts[i].src that is coming out to be undefined.</p>
<p>Thanks,<br />
Utkarsh</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Yii-Framework: Preventing duplicate JS/CSS includes for ajax requests by Utkarsh</title>
		<link>http://www.eirikhoem.net/blog/2011/08/29/yii-framework-preventing-duplicate-jscss-includes-for-ajax-requests/#comment-5048</link>
		<dc:creator>Utkarsh</dc:creator>
		<pubDate>Mon, 24 Oct 2011 19:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.eirikhoem.net/blog/?p=361#comment-5048</guid>
		<description>Clever solution. I was looking for something like this only. 

Many Thanks,
Utkarsh</description>
		<content:encoded><![CDATA[<p>Clever solution. I was looking for something like this only. </p>
<p>Many Thanks,<br />
Utkarsh</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Populate PDF templates with PHP / FPDF / FPDI by kevin</title>
		<link>http://www.eirikhoem.net/blog/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/#comment-115</link>
		<dc:creator>kevin</dc:creator>
		<pubDate>Sat, 02 Apr 2011 08:36:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/04/28/populate-pdf-templates-with-php-fpdf-fpdi/#comment-115</guid>
		<description>hi. I have been testing this for the last hour and I don&#039;t think it can do hat I need it to do. Here is what I need: I have an html form on my website, name, address, phone number, your equipment&#039;s serial number, etc.
When customers fill that out and press submit, I want a pdf document to open with all this information, so they can print it out and send it...is that possible? When I tried to test it, all it does is print &quot;John Doe, Downtown Streeet 12...&quot;</description>
		<content:encoded><![CDATA[<p>hi. I have been testing this for the last hour and I don&#8217;t think it can do hat I need it to do. Here is what I need: I have an html form on my website, name, address, phone number, your equipment&#8217;s serial number, etc.<br />
When customers fill that out and press submit, I want a pdf document to open with all this information, so they can print it out and send it&#8230;is that possible? When I tried to test it, all it does is print &#8220;John Doe, Downtown Streeet 12&#8230;&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XNA Platformer Starter Kit &#8211; Falling Apples by admin</title>
		<link>http://www.eirikhoem.net/blog/2009/03/01/xna-platformer-starter-kit-falling-apples/#comment-202</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 21 Mar 2011 10:49:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=67#comment-202</guid>
		<description>&quot;I wanna be the guy&quot; is not a virus, it&#039;s a rather entertaining game :)</description>
		<content:encoded><![CDATA[<p>&#8220;I wanna be the guy&#8221; is not a virus, it&#8217;s a rather entertaining game <img src='http://www.eirikhoem.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XNA Platformer Starter Kit &#8211; Falling Apples by Mike</title>
		<link>http://www.eirikhoem.net/blog/2009/03/01/xna-platformer-starter-kit-falling-apples/#comment-201</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 21 Mar 2011 10:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=67#comment-201</guid>
		<description>opps...the link is &quot;I wanna be the guy&quot; that downloads a fake alert virus.</description>
		<content:encoded><![CDATA[<p>opps&#8230;the link is &#8220;I wanna be the guy&#8221; that downloads a fake alert virus.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XNA Platformer Starter Kit &#8211; Falling Apples by Mike</title>
		<link>http://www.eirikhoem.net/blog/2009/03/01/xna-platformer-starter-kit-falling-apples/#comment-200</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 21 Mar 2011 10:46:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/?p=67#comment-200</guid>
		<description>Theres a VIRUS on your site, I win be the guy link? WTF????</description>
		<content:encoded><![CDATA[<p>Theres a VIRUS on your site, I win be the guy link? WTF????</p>
]]></content:encoded>
	</item>
</channel>
</rss>
