<?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: Javascript Gotcha: Invalid Assignment Left-Hand Side</title>
	<atom:link href="http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/</link>
	<description>Distracting the Mind with Information Overload</description>
	<lastBuildDate>Mon, 16 Jan 2012 21:10:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Naveen</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-84444</link>
		<dc:creator>Naveen</dc:creator>
		<pubDate>Tue, 31 May 2011 08:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-84444</guid>
		<description>How to go about doing the same for params passed ?? :( 
I want to pass -1 as a param and JS is killing me with this..</description>
		<content:encoded><![CDATA[<p>How to go about doing the same for params passed ?? <img src='http://www.u-g-h.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
I want to pass -1 as a param and JS is killing me with this..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zikki</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-84274</link>
		<dc:creator>Zikki</dc:creator>
		<pubDate>Sat, 23 Apr 2011 12:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-84274</guid>
		<description>Aww yeah! i am so glad I found this post.  I looked for a similar problem and found a &quot;=&quot; instead of a &quot;==&quot; in one of my if statements.  I&#039;m telling you its the small little errors that take up so much time.

Thanks to Owen for posting this!

@Daniel
Sorry I can&#039;t help you on that one.  Are you sure it&#039;s that line? if you click on the error on firefox error console, it will take you to the line where it found the error.
best of luck.</description>
		<content:encoded><![CDATA[<p>Aww yeah! i am so glad I found this post.  I looked for a similar problem and found a &#8220;=&#8221; instead of a &#8220;==&#8221; in one of my if statements.  I&#8217;m telling you its the small little errors that take up so much time.</p>
<p>Thanks to Owen for posting this!</p>
<p>@Daniel<br />
Sorry I can&#8217;t help you on that one.  Are you sure it&#8217;s that line? if you click on the error on firefox error console, it will take you to the line where it found the error.<br />
best of luck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: daniel</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-79129</link>
		<dc:creator>daniel</dc:creator>
		<pubDate>Thu, 02 Dec 2010 11:06:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-79129</guid>
		<description>I&#039;m having the same problem : I&#039;m using dynamic variables and when I try to assign the value to the dynamic variable I receive the same error as you did.

This is part of my code:
for (var i=0; i&lt;(title.length-1);i++){
        eval (&quot;var title&quot;+i) = title[i].get(&#039;html&#039;).toString().replace(&#039;&lt;!-- --&gt;&#039;, &#039;&#039;); //and the code goes on...

 What I want to do is to create variables like these: title0, title1, title2...title(i++)

Any idea why this doesn&#039;t work?</description>
		<content:encoded><![CDATA[<p>I&#8217;m having the same problem : I&#8217;m using dynamic variables and when I try to assign the value to the dynamic variable I receive the same error as you did.</p>
<p>This is part of my code:<br />
for (var i=0; i&lt;(title.length-1);i++){<br />
        eval (&quot;var title&quot;+i) = title[i].get(&#039;html&#039;).toString().replace(&#039;<!-- -->&#8216;, &#8221;); //and the code goes on&#8230;</p>
<p> What I want to do is to create variables like these: title0, title1, title2&#8230;title(i++)</p>
<p>Any idea why this doesn&#8217;t work?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: droope</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-77445</link>
		<dc:creator>droope</dc:creator>
		<pubDate>Wed, 28 Apr 2010 16:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-77445</guid>
		<description>Gotta love javascript error reporting.</description>
		<content:encoded><![CDATA[<p>Gotta love javascript error reporting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Pugh</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-77345</link>
		<dc:creator>Eric Pugh</dc:creator>
		<pubDate>Wed, 21 Apr 2010 17:15:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-77345</guid>
		<description>I had a bit of ruby code generating a variable in JS that was failing:

  check_var__ = false;

I had spaces in core.solr.name, so I swapped to using dashes.   And then had more errors, thank you for this post, it highlighted my problem!</description>
		<content:encoded><![CDATA[<p>I had a bit of ruby code generating a variable in JS that was failing:</p>
<p>  check_var__ = false;</p>
<p>I had spaces in core.solr.name, so I swapped to using dashes.   And then had more errors, thank you for this post, it highlighted my problem!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: magicrebirth</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-76055</link>
		<dc:creator>magicrebirth</dc:creator>
		<pubDate>Wed, 30 Sep 2009 16:51:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-76055</guid>
		<description>thanks man that saved me tons of time (and coffees!)</description>
		<content:encoded><![CDATA[<p>thanks man that saved me tons of time (and coffees!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josh</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-75740</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Thu, 20 Aug 2009 16:52:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-75740</guid>
		<description>It was actually a case of blah.style.background-color=&#039;blah&#039;; for me. if i did background_color, the rest of the js ran ok, but i had to use backgroundColor to actually set and access the element&#039;s color.</description>
		<content:encoded><![CDATA[<p>It was actually a case of blah.style.background-color=&#8217;blah&#8217;; for me. if i did background_color, the rest of the js ran ok, but i had to use backgroundColor to actually set and access the element&#8217;s color.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zachary</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-75126</link>
		<dc:creator>Zachary</dc:creator>
		<pubDate>Sat, 20 Jun 2009 22:38:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-75126</guid>
		<description>Thank you so much!  I have spent a couple of days trying to figure out what was wrong with a function I created and out of frustration turned to Google and found this page after a lot of searching.  This fixed many of the problems I was having.  Thanks again!</description>
		<content:encoded><![CDATA[<p>Thank you so much!  I have spent a couple of days trying to figure out what was wrong with a function I created and out of frustration turned to Google and found this page after a lot of searching.  This fixed many of the problems I was having.  Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Art</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-71976</link>
		<dc:creator>Art</dc:creator>
		<pubDate>Thu, 11 Dec 2008 16:51:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-71976</guid>
		<description>Did you know that this post comes up #2 in Google for the term &quot;invalid assignment left-hand side&quot;?

Well it does, and I&#039;m really glad because you just saved me some serious time trying to research the error.

Kudos!</description>
		<content:encoded><![CDATA[<p>Did you know that this post comes up #2 in Google for the term &#8220;invalid assignment left-hand side&#8221;?</p>
<p>Well it does, and I&#8217;m really glad because you just saved me some serious time trying to research the error.</p>
<p>Kudos!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Thompson</title>
		<link>http://www.u-g-h.com/2008/08/18/javascript-gotcha-invalid-assignment-left-hand-side/comment-page-1/#comment-71463</link>
		<dc:creator>Jesse Thompson</dc:creator>
		<pubDate>Sat, 15 Nov 2008 01:38:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.u-g-h.com/?p=2333#comment-71463</guid>
		<description>That&#039;s not so inexplicable, &quot;-&quot; just isn&#039;t a valid character for identifiers in javascript. It&#039;s reserved for uses like the minus sign.

Seriously, how else will Javascript know what you want when you talk about:

this.a-that.b

Are we accessing property b within propterty &quot;a-that&quot;, or are we subtracting this.b from this.a? So, the minus sign just can&#039;t be used in bare identifiers.

It&#039;s true that you can use form names that contain characters that don&#039;t make valid JS identifiers, and in that case the bracket syntax saves the day.

As to why using a _ worked instead, there might be a provision in there somewhere which aliases abc-def and abc_def to mean the same thing. I for one would not count on such a provision however, as [] syntax clarifies your intentions unambiguously.

Mangia. :D

- - Jesse</description>
		<content:encoded><![CDATA[<p>That&#8217;s not so inexplicable, &#8220;-&#8221; just isn&#8217;t a valid character for identifiers in javascript. It&#8217;s reserved for uses like the minus sign.</p>
<p>Seriously, how else will Javascript know what you want when you talk about:</p>
<p>this.a-that.b</p>
<p>Are we accessing property b within propterty &#8220;a-that&#8221;, or are we subtracting this.b from this.a? So, the minus sign just can&#8217;t be used in bare identifiers.</p>
<p>It&#8217;s true that you can use form names that contain characters that don&#8217;t make valid JS identifiers, and in that case the bracket syntax saves the day.</p>
<p>As to why using a _ worked instead, there might be a provision in there somewhere which aliases abc-def and abc_def to mean the same thing. I for one would not count on such a provision however, as [] syntax clarifies your intentions unambiguously.</p>
<p>Mangia. <img src='http://www.u-g-h.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>- &#8211; Jesse</p>
]]></content:encoded>
	</item>
</channel>
</rss>

