<?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>The Developer Day &#187; JavaScript</title>
	<atom:link href="http://www.thedeveloperday.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thedeveloperday.com</link>
	<description>Staying Curious</description>
	<lastBuildDate>Fri, 03 Feb 2012 12:03:22 +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>Internet Explorer HTTP_REFERER javacript redirect issue</title>
		<link>http://www.thedeveloperday.com/internet-explorer-http_referer-javacript-redirect-issue/</link>
		<comments>http://www.thedeveloperday.com/internet-explorer-http_referer-javacript-redirect-issue/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 16:26:18 +0000</pubDate>
		<dc:creator>Žilvinas Šaltys</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[referer]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.thedeveloperday.com/?p=129</guid>
		<description><![CDATA[Internet Explorer has a strange issue regarding http referers. If you would have a link and would follow that link $_SERVER['HTTP_REFERER'] value would get populated. But if a redirect is done using javascript like this: top.location.href = 'page.php'; The HTTP_REFERER will not get value populated. I tried to figure out why is this happening but seems [...]]]></description>
			<content:encoded><![CDATA[<p>Internet Explorer has a strange issue regarding http referers. If you would have a link and would follow that link $_SERVER['HTTP_REFERER'] value would get populated. But if a redirect is done using javascript like this:</p>
<pre name="code" class="javascript:nogutter">top.location.href = 'page.php';</pre>
<p>The HTTP_REFERER will not get value populated. I tried to figure out why is this happening but seems it&#8217;s just the way it is. All other browsers Firefox, Chrome, Opera will set the referer properly, but IE6, IE7 and IE8 will not.</p>
<p>Though it is not a good practice to rely on HTTP_REFERER and you should probably not use it if you can, but nevertheless such kind of behaviour may cause strange bugs. If you happen to know why Internet Explorer behaves like this or know workaround to still have a referer value set when the browser redirects using javascript please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedeveloperday.com/internet-explorer-http_referer-javacript-redirect-issue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript Radio Group Value Tip Using Prototype</title>
		<link>http://www.thedeveloperday.com/javascript-radio-group-value-tip/</link>
		<comments>http://www.thedeveloperday.com/javascript-radio-group-value-tip/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 13:56:15 +0000</pubDate>
		<dc:creator>Žilvinas Šaltys</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.thedeveloperday.com/javascript-radio-group-value-tip/</guid>
		<description><![CDATA[A simple tip how to find out radio group value with prototype: var value; Form.getInputs(this.form, 'radio').each( function(input) { if (input.checked) { value = input.value }; });]]></description>
			<content:encoded><![CDATA[<p>A simple tip how to find out radio group value with prototype:</p>
<pre name="code" class="js:nogutter">var value;
Form.getInputs(this.form, 'radio').each( function(input) { if (input.checked) { value = input.value }; });
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thedeveloperday.com/javascript-radio-group-value-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript forms innerHTML issue</title>
		<link>http://www.thedeveloperday.com/javascript-forms-innerhtml-issue/</link>
		<comments>http://www.thedeveloperday.com/javascript-forms-innerhtml-issue/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 08:46:57 +0000</pubDate>
		<dc:creator>Žilvinas Šaltys</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.thedeveloperday.com/javascript-forms-innerhtml-issue/</guid>
		<description><![CDATA[If you would do something like this while validating a form: document.getElementById('your_form_id').innerHTML += 'any text'; Your form will get reseted and there&#8217;s nothing more to validate.]]></description>
			<content:encoded><![CDATA[<p>If you would do something like this while validating a form:</p>
<pre class="js:nogutter">document.getElementById('your_form_id').innerHTML += 'any text';</pre>
<p>Your form will get reseted and there&#8217;s nothing more to validate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedeveloperday.com/javascript-forms-innerhtml-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Associative Arrays &amp; Iterations</title>
		<link>http://www.thedeveloperday.com/iterate-javascript-associative-arrays/</link>
		<comments>http://www.thedeveloperday.com/iterate-javascript-associative-arrays/#comments</comments>
		<pubDate>Mon, 06 Aug 2007 14:48:42 +0000</pubDate>
		<dc:creator>Žilvinas Šaltys</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[associative]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[iterators]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.thedeveloperday.com/iterate-javascript-associative-arrays/</guid>
		<description><![CDATA[Today I was working with a little piece of JavaScript code and writing something like this: var tmp = new Array(); tmp['id']= '123'; tmp['name'] = 'bla bla'; And then i tried to iterate over the array like this: for (var i in tmp) { alert(i); }; If you haven&#8217;t done a lot of JavaScript you [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was working with a little piece of JavaScript code and writing something like this:</p>
<pre name="code" class="js:nogutter">var tmp = new Array();
tmp['id']= '123';
tmp['name'] = 'bla bla';</pre>
<p>And then i tried to iterate over the array like this:</p>
<pre name="code" class="js:nogutter">for (var i in tmp) { alert(i); };</pre>
<p>If you haven&#8217;t done a lot of JavaScript you would probably say that the above iteration should output &#8216;id&#8217;, &#8216;name&#8217;. Surprisingly you may be wrong. If you are using any code that extends the Array prototype with attributes or functions you will see them in the output. This may happen if you are using the <a href="http://www.prototypejs.org/" title="popular javascript framework">prototype framework</a> or <a href="http://www.json.org/json.js" title="default json stringifier">The open source code of a JSON parser and JSON stringifier</a>. All you&#8217;re doing is setting properties on an object. After reading a few blog posts and comments on this I found yet another issue that ideally I shouldn&#8217;t be using new Array() and using new Object(). That sounds kind of true because JavaScript does not support associative arrays and you could do the same on any object. Date, RegExp, Boolean or any other. Actually using Object solved the prototype framework problem, because prototype framework does not extend the Object prototype since 1.4 but the <a href="http://www.json.org/json.js" title="default javascript json library">JSON stringifier</a> does.</p>
<p>After googling a while I found out a little tricksy that may mostly work with this problem.  You could do something like this:</p>
<pre name="code" class="js:nogutter">for (var i in obj) {
if (!obj.propertyIsEnumerable(i)) continue;
foo(obj[i]);
}</pre>
<p>This only works if properties are enumerable. That may not always save you especially if you are using any 3rd party software that breaks this, but it certainly helps you while solving the prototype framework or JSON stringifier puzzle.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thedeveloperday.com/iterate-javascript-associative-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

