<?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: PHP-style $GLOBALS in Javascript?</title>
	<atom:link href="http://www.phpied.com/php-style-globals-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpied.com/php-style-globals-in-javascript/</link>
	<description>Stoyan&#039;s blog about &#60;a href=&#34;/category/xhtml&#34; class=&#34;tag-minor&#34;&#62;(x)html(5)&#60;/a&#62;, &#60;a href=&#34;/category/ajax&#34; class=&#34;tag-major&#34;&#62;ajax&#60;/a&#62;, &#60;a href=&#34;/category/bookmarklets&#34; class=&#34;tag-major&#34;&#62;bookmarklets&#60;/a&#62;, &#60;a href=&#34;/category/browsers&#34; class=&#34;tag-minor&#34;&#62;browsers&#60;/a&#62;, &#60;a href=&#34;/category/css&#34; class=&#34;tag-normal&#34;&#62;css&#60;/a&#62;, &#60;a href=&#34;/category/firebug&#34; class=&#34;tag-minor&#34;&#62;firebug&#60;/a&#62;, &#60;a href=&#34;/category/javascript&#34; class=&#34;tag-numero-uno&#34;&#62;javascript&#60;/a&#62;, &#60;a href=&#34;/category/json&#34; class=&#34;tag-normal&#34;&#62;json&#60;/a&#62;, &#60;a href=&#34;/category/mdb2&#34; class=&#34;tag-minor&#34;&#62;mdb2&#60;/a&#62;, &#60;a href=&#34;/category/mysql&#34; class=&#34;tag-normal&#34;&#62;mysql&#60;/a&#62;, &#60;a href=&#34;/category/pear&#34; class=&#34;tag-numero-uno&#34;&#62;pear&#60;/a&#62;, &#60;a href=&#34;/category/performance&#34; class=&#34;tag-major&#34;&#62;performance&#60;/a&#62;, &#60;a href=&#34;/category/php&#34; class=&#34;tag-numero-uno&#34;&#62;php&#60;/a&#62;, &#60;a href=&#34;/category/phpbb&#34; class=&#34;tag-major&#34;&#62;phpbb&#60;/a&#62;, &#60;a href=&#34;/category/tools&#34; class=&#34;tag-normal&#34;&#62;tools&#60;/a&#62;, &#60;a href=&#34;/category/yslow&#34; class=&#34;tag-minor&#34;&#62;yslow&#60;/a&#62;, &#60;a href=&#34;/category/yui&#34; class=&#34;tag-normal&#34;&#62;yui&#60;/a&#62;, &#60;a href=&#34;/category/writing&#34; class=&#34;tag-minor&#34;&#62;writing&#60;/a&#62;, &#60;a href=&#34;/category/music&#34; class=&#34;tag-major&#34;&#62;music&#60;/a&#62;,... &#60;a href=&#34;/category/life-and-everything&#34; class=&#34;tag-normal&#34;&#62;life and everything&#60;/a&#62;.</description>
	<lastBuildDate>Sat, 11 Feb 2012 14:07:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: gratis läromedel</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-80375</link>
		<dc:creator>gratis läromedel</dc:creator>
		<pubDate>Mon, 28 Nov 2011 21:08:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-80375</guid>
		<description>V&#228;lj mellan mat, st&#229;tlighet, h&#228;lsa, sm&#229;barn, husdjur, hus riktning, b&#246;cker ytterligare tidningar, kontorsmaterial, verktyg ytterligare mycket mer.
 &lt;a href=&quot;http://albertware.mywapblog.com/learning-to-make-rapid-income-the-simple.xhtml&quot; rel=&quot;nofollow&quot;&gt;erbjudande köpenhamn
&lt;/a&gt; Till exempel: Ett exempel &#228;r vid onlinebooks.</description>
		<content:encoded><![CDATA[<p>V&auml;lj mellan mat, st&aring;tlighet, h&auml;lsa, sm&aring;barn, husdjur, hus riktning, b&ouml;cker ytterligare tidningar, kontorsmaterial, verktyg ytterligare mycket mer.<br />
 <a href="http://albertware.mywapblog.com/learning-to-make-rapid-income-the-simple.xhtml" rel="nofollow">erbjudande köpenhamn<br />
</a> Till exempel: Ett exempel &auml;r vid onlinebooks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SHyam</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-71276</link>
		<dc:creator>SHyam</dc:creator>
		<pubDate>Sat, 01 Aug 2009 11:38:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-71276</guid>
		<description>PHP GLOBALS suck. ANd bcos of this PHP suckz... how many noobz here use GLOBALS... my server always has register_globals turned off.... now the scripts of these basturds wont run... ha haaaaaaaaaaaa</description>
		<content:encoded><![CDATA[<p>PHP GLOBALS suck. ANd bcos of this PHP suckz&#8230; how many noobz here use GLOBALS&#8230; my server always has register_globals turned off&#8230;. now the scripts of these basturds wont run&#8230; ha haaaaaaaaaaaa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoyan</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-64084</link>
		<dc:creator>Stoyan</dc:creator>
		<pubDate>Tue, 18 Mar 2008 00:39:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-64084</guid>
		<description>Hi Marco,

I used the dollar sign just for the sake of the PHP analogy, and a little bit as a joke in the spirit of &quot;let&#039;s make JS like our other favorite language&quot; (looking at you, prototype.js). 

Using a namespace and a GLOBALS property is definitely a good way to do the same.</description>
		<content:encoded><![CDATA[<p>Hi Marco,</p>
<p>I used the dollar sign just for the sake of the PHP analogy, and a little bit as a joke in the spirit of &#8220;let&#8217;s make JS like our other favorite language&#8221; (looking at you, prototype.js). </p>
<p>Using a namespace and a GLOBALS property is definitely a good way to do the same.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-64055</link>
		<dc:creator>Marco</dc:creator>
		<pubDate>Thu, 13 Mar 2008 21:45:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-64055</guid>
		<description>Interesting idea Stoyan!

Just out of curiosity though: why use a dollar sign? Just because it&#039;s more PHP-ish or is there another reason?

Also: In a YUI context you may want to use YAHOO.GLOBALS maybe? :)</description>
		<content:encoded><![CDATA[<p>Interesting idea Stoyan!</p>
<p>Just out of curiosity though: why use a dollar sign? Just because it&#8217;s more PHP-ish or is there another reason?</p>
<p>Also: In a YUI context you may want to use YAHOO.GLOBALS maybe? <img src='http://www.phpied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoyan Stefanov&#8217;s Blog: PHP-style $GLOBALS in Javascript? &#124; Cole Design Studios</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-64053</link>
		<dc:creator>Stoyan Stefanov&#8217;s Blog: PHP-style $GLOBALS in Javascript? &#124; Cole Design Studios</dc:creator>
		<pubDate>Thu, 13 Mar 2008 06:15:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-64053</guid>
		<description>[...] In a new post to his blog today, Stoyan Stefanov has a proposal to being something PHP users are very used to - superglobals - over to Javascript.   Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. [&#8230;] In PHP on the other hand, variables are local. [&#8230;] So how about this: adopt the $GLOBALS convention in your JavaScripts? [...]</description>
		<content:encoded><![CDATA[<p>[...] In a new post to his blog today, Stoyan Stefanov has a proposal to being something PHP users are very used to &#8211; superglobals &#8211; over to Javascript.   Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. [&#8230;] In PHP on the other hand, variables are local. [&#8230;] So how about this: adopt the $GLOBALS convention in your JavaScripts? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoyan Stefanov&#8217;s Blog: PHP-style $GLOBALS in Javascript? &#124; Cole Design Studios</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-64052</link>
		<dc:creator>Stoyan Stefanov&#8217;s Blog: PHP-style $GLOBALS in Javascript? &#124; Cole Design Studios</dc:creator>
		<pubDate>Thu, 13 Mar 2008 06:15:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-64052</guid>
		<description>[...] In a new post to his blog today, Stoyan Stefanov has a proposal to being something PHP users are very used to - superglobals - over to Javascript.   Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. [&#8230;] In PHP on the other hand, variables are local. [&#8230;] So how about this: adopt the $GLOBALS convention in your JavaScripts? [...]</description>
		<content:encoded><![CDATA[<p>[...] In a new post to his blog today, Stoyan Stefanov has a proposal to being something PHP users are very used to &#8211; superglobals &#8211; over to Javascript.   Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. [&#8230;] In PHP on the other hand, variables are local. [&#8230;] So how about this: adopt the $GLOBALS convention in your JavaScripts? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Coates</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-64047</link>
		<dc:creator>Sean Coates</dc:creator>
		<pubDate>Wed, 12 Mar 2008 14:40:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-64047</guid>
		<description>They aren&#039;t really globals in JavaScript. The scope actually comes from the parent. Undefined variables appear to be global, that&#039;s true.

Scoping is really &quot;weird&quot; in JS if you&#039;ve never worked in another language that does closures. See:
http://en.wikipedia.org/wiki/Closure_(computer_science)

Not saying you&#039;re wrong, of course, but thinking about JavaScript scopes the same way you think about PHP scopes is likely to lead to maintenance/development trouble down the road (-:

S</description>
		<content:encoded><![CDATA[<p>They aren&#8217;t really globals in JavaScript. The scope actually comes from the parent. Undefined variables appear to be global, that&#8217;s true.</p>
<p>Scoping is really &#8220;weird&#8221; in JS if you&#8217;ve never worked in another language that does closures. See:<br />
<a href="http://en.wikipedia.org/wiki/Closure_(computer_science)" rel="nofollow">http://en.wikipedia.org/wiki/Closure_(computer_science)</a></p>
<p>Not saying you&#8217;re wrong, of course, but thinking about JavaScript scopes the same way you think about PHP scopes is likely to lead to maintenance/development trouble down the road (-:</p>
<p>S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoyan Stefanov&#8217;s Blog: PHP-style $GLOBALS in Javascript? &#124; Development Blog With Code Updates : Developercast.com</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-64044</link>
		<dc:creator>Stoyan Stefanov&#8217;s Blog: PHP-style $GLOBALS in Javascript? &#124; Development Blog With Code Updates : Developercast.com</dc:creator>
		<pubDate>Wed, 12 Mar 2008 12:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-64044</guid>
		<description>[...] In a new post to his blog today, Stoyan Stefanov has a proposal to being something PHP users are very used to - superglobals - over to Javascript.   Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. [&#8230;] In PHP on the other hand, variables are local. [&#8230;] So how about this: adopt the $GLOBALS convention in your JavaScripts? [...]</description>
		<content:encoded><![CDATA[<p>[...] In a new post to his blog today, Stoyan Stefanov has a proposal to being something PHP users are very used to &#8211; superglobals &#8211; over to Javascript.   Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. [&#8230;] In PHP on the other hand, variables are local. [&#8230;] So how about this: adopt the $GLOBALS convention in your JavaScripts? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHPDeveloper.org</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-64043</link>
		<dc:creator>PHPDeveloper.org</dc:creator>
		<pubDate>Wed, 12 Mar 2008 11:56:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-64043</guid>
		<description>&lt;strong&gt;Stoyan Stefanov&#039;s Blog: PHP-style $GLOBALS in Javascript?...&lt;/strong&gt;


In a new post to his blog today, Stoyan Stefanov has ......</description>
		<content:encoded><![CDATA[<p><strong>Stoyan Stefanov&#8217;s Blog: PHP-style $GLOBALS in Javascript?&#8230;</strong></p>
<p>In a new post to his blog today, Stoyan Stefanov has &#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stoyan</title>
		<link>http://www.phpied.com/php-style-globals-in-javascript/#comment-64009</link>
		<dc:creator>Stoyan</dc:creator>
		<pubDate>Mon, 10 Mar 2008 17:33:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.phpied.com/php-style-globals-in-javascript/#comment-64009</guid>
		<description>Thanks Steve! Worst of all, &lt;code&gt;&lt;input id=&quot;tmp&quot; /&gt;&lt;/code&gt; declares a global var &lt;code&gt;tmp&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Thanks Steve! Worst of all, <code>&lt;input id="tmp" /&gt;</code> declares a global var <code>tmp</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

