<?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 on: Three handy javascript techniques</title>
	<atom:link href="http://solutoire.com/2007/08/21/three-handy-javascript-techniques/feed/" rel="self" type="application/rss+xml" />
	<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/</link>
	<description>Publicing platform</description>
	<lastBuildDate>Fri, 03 Feb 2012 08:33:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Trinithis</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-11884</link>
		<dc:creator>Trinithis</dc:creator>
		<pubDate>Mon, 14 Jan 2008 22:30:22 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-11884</guid>
		<description>&lt;code&gt;arguments.calllee&lt;/code&gt; is NOT depricated. In fact, I use it over the function&#039;s name due to refractoring purposes.

You might be confused with &lt;code&gt;Function.arguments.callee&lt;/code&gt; because that is depricated.</description>
		<content:encoded><![CDATA[<p><code>arguments.calllee</code> is NOT depricated. In fact, I use it over the function&#8217;s name due to refractoring purposes.</p>
<p>You might be confused with <code>Function.arguments.callee</code> because that is depricated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: serkanyersen</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-11804</link>
		<dc:creator>serkanyersen</dc:creator>
		<pubDate>Fri, 11 Jan 2008 08:10:55 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-11804</guid>
		<description>use alisasing isteadof with
&#039;&lt;code&gt;el2 = el.arg1.arg2.arg3.looong.use
alert(el2.someVal);
&lt;/code&gt;

This faster safer and usable.

Great blog by the way.</description>
		<content:encoded><![CDATA[<p>use alisasing isteadof with<br />
&#8216;<code>el2 = el.arg1.arg2.arg3.looong.use<br />
alert(el2.someVal);<br />
</code></p>
<p>This faster safer and usable.</p>
<p>Great blog by the way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: digitarald</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-8132</link>
		<dc:creator>digitarald</dc:creator>
		<pubDate>Sun, 23 Sep 2007 07:41:11 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-8132</guid>
		<description>Just as quick note: arguments.callee is not deprecated, Function.arguments including its properties (callee ...) is deprecated, in favor of the functions local variable arguments.

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Functions:arguments:callee</description>
		<content:encoded><![CDATA[<p>Just as quick note: arguments.callee is not deprecated, Function.arguments including its properties (callee &#8230;) is deprecated, in favor of the functions local variable arguments.</p>
<p><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Functions:arguments:callee" rel="nofollow">http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Functions:arguments:callee</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bas</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-7266</link>
		<dc:creator>Bas</dc:creator>
		<pubDate>Wed, 22 Aug 2007 10:20:37 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-7266</guid>
		<description>I&#039;ll fix it for you :), thanks for sharing!</description>
		<content:encoded><![CDATA[<p>I&#8217;ll fix it for you :), thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: simon</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-7264</link>
		<dc:creator>simon</dc:creator>
		<pubDate>Wed, 22 Aug 2007 09:56:36 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-7264</guid>
		<description>hmmm, apparently I suck at using that funky markup business :)</description>
		<content:encoded><![CDATA[<p>hmmm, apparently I suck at using that funky markup business :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: simon</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-7263</link>
		<dc:creator>simon</dc:creator>
		<pubDate>Wed, 22 Aug 2007 09:54:14 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-7263</guid>
		<description>If I remember rightly, the with keyword only reliably works with predefined namespaces in that if you were working with an object that looks like:
&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;var ob =  {
   x: 12,
   y: &quot;hello&quot;
}
&lt;/code&gt;&lt;/pre&gt;


then 

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;with(ob) {
   x += 1;
}
&lt;/code&gt;&lt;/pre&gt;


would work no worries, however you couldn&#039;t do:

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;with(ob) {
  z = 12;
}
&lt;/code&gt;&lt;/pre&gt;


and for this reason it might be more versatile to use a simple object assignation, like so (this time using a more contextual / useful / complete example):

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;var p = Array.prototype;
p.toJSON = function{
   ...
}
&lt;/code&gt;&lt;/pre&gt;

thus gaining the benefits of smaller code (albeit slightly less small with bigger operations) using a much more flexible method.</description>
		<content:encoded><![CDATA[<p>If I remember rightly, the with keyword only reliably works with predefined namespaces in that if you were working with an object that looks like:</p>
<pre><code class="javascript">var ob =  {
   x: 12,
   y: "hello"
}
</code></pre>
<p>then </p>
<pre><code class="javascript">with(ob) {
   x += 1;
}
</code></pre>
<p>would work no worries, however you couldn&#8217;t do:</p>
<pre><code class="javascript">with(ob) {
  z = 12;
}
</code></pre>
<p>and for this reason it might be more versatile to use a simple object assignation, like so (this time using a more contextual / useful / complete example):</p>
<pre><code class="javascript">var p = Array.prototype;
p.toJSON = function{
   ...
}
</code></pre>
<p>thus gaining the benefits of smaller code (albeit slightly less small with bigger operations) using a much more flexible method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bas Wenneker</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-7241</link>
		<dc:creator>Bas Wenneker</dc:creator>
		<pubDate>Tue, 21 Aug 2007 15:26:16 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-7241</guid>
		<description>Oh, sorry, now I see what you mean. Yeah you&#039;re right, the &#039;a&#039; is in the word &#039;span&#039;, so this condition returns true. To have that problem fixed I&#039;d use something like this:

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;if( &#039;&#124;p&#124;span&#124;&#039;.indexOf( &#039;&#124;&#039; + tagName + &#039;&#124;&#039; ) ){
     // Some action
}
&lt;/code&gt;&lt;/pre&gt;

Thanks for pointing me on this.</description>
		<content:encoded><![CDATA[<p>Oh, sorry, now I see what you mean. Yeah you&#8217;re right, the &#8216;a&#8217; is in the word &#8216;span&#8217;, so this condition returns true. To have that problem fixed I&#8217;d use something like this:</p>
<pre><code class="javascript">if( '|p|span|'.indexOf( '|' + tagName + '|' ) ){
     // Some action
}
</code></pre>
<p>Thanks for pointing me on this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: los</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-7240</link>
		<dc:creator>los</dc:creator>
		<pubDate>Tue, 21 Aug 2007 15:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-7240</guid>
		<description>The reason why I would use another solution is in the first line of my first comment: The &quot;simpler&quot; condition which uses indexOf is NOT EQUAL to the original condition!</description>
		<content:encoded><![CDATA[<p>The reason why I would use another solution is in the first line of my first comment: The &#8220;simpler&#8221; condition which uses indexOf is NOT EQUAL to the original condition!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bas</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-7239</link>
		<dc:creator>Bas</dc:creator>
		<pubDate>Tue, 21 Aug 2007 14:49:35 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-7239</guid>
		<description>@Ios: That&#039;s also a solution, but like you wrote, you need to implement Array.contains().
@Tommy: Regular expressions are computationally heavier than String functions (most of the times), but if that doesn&#039;t matter, you&#039;re completely right.</description>
		<content:encoded><![CDATA[<p>@Ios: That&#8217;s also a solution, but like you wrote, you need to implement Array.contains().<br />
@Tommy: Regular expressions are computationally heavier than String functions (most of the times), but if that doesn&#8217;t matter, you&#8217;re completely right.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy Valand</title>
		<link>http://solutoire.com/2007/08/21/three-handy-javascript-techniques/comment-page-1/#comment-7237</link>
		<dc:creator>Tommy Valand</dc:creator>
		<pubDate>Tue, 21 Aug 2007 13:57:47 +0000</pubDate>
		<guid isPermaLink="false">http://solutoire.com/2007/08/21/three-handy-javascript-techniques/#comment-7237</guid>
		<description>Regarding tip 2, if you have som familiarity with Regular Expression, you can save even more code:

&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;/*
parenthesis around regexp not needed
but easier to read
i for case-insensitive
^ start of string
$ end of string
*/
if( (/^(div&#124;input&#124;p&#124;span&#124;blockquote)$/i).test( document.getElementById(&#039;id&#039;).tagName ) ){
	//dostuff
}
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Regarding tip 2, if you have som familiarity with Regular Expression, you can save even more code:</p>
<pre><code class="javascript">/*
parenthesis around regexp not needed
but easier to read
i for case-insensitive
^ start of string
$ end of string
*/
if( (/^(div|input|p|span|blockquote)$/i).test( document.getElementById('id').tagName ) ){
	//dostuff
}
</code></pre>
]]></content:encoded>
	</item>
</channel>
</rss>

