<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-4222197394079314848.post7529161154058402421..comments</id><updated>2011-09-09T14:55:20.376-05:00</updated><category term='Cygwin'/><category term='Microsoft .NET'/><category term='will need again'/><category term='Palm'/><category term='Apple'/><category term='Oracle'/><category term='MarkUtils'/><category term='audio'/><category term='Dell'/><category term='email'/><category term='performance'/><category term='reported bugs'/><category term='free tools'/><category term='hardware'/><category term='laptop'/><category term='IPv6'/><category term='xml'/><category term='SysAdmin'/><category term='Alltel'/><category term='technical'/><category term='OpenWrt'/><category term='security'/><category term='Appleton-WI'/><category term='Sun Microsystems'/><category term='Microsoft Word'/><category term='Java'/><category term='Blogger'/><category term='Google'/><category term='networking'/><category term='Hewlett-Packard'/><category term='LDAP'/><category term='frustrations'/><category term='life'/><category term='Firefox'/><category term='Microsoft Windows'/><category term='VMware'/><category term='JMX'/><category term='Ext JS'/><category term='web browsing'/><category term='Linux'/><category term='Rothschild-WI'/><category term='Eclipse'/><category term='coding'/><category term='WScript'/><category term='OpenOffice.org'/><category term='JavaScript'/><category term='Yahoo UI Library'/><category term='Java Swing'/><category term='Microsoft Outook'/><title type='text'>Comments on Mark A. Ziesemer: Respecting the JavaScript global namespace</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blogger.ziesemer.com/feeds/7529161154058402421/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default?start-index=26&amp;max-results=25'/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://2.bp.blogspot.com/_aV4l4vyh5uQ/S31T85WfmMI/AAAAAAAAA9U/nRo4aI0okiQ/S220/Facebook+Me.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-8834852852085292803</id><published>2010-09-07T08:37:57.754-05:00</published><updated>2010-09-07T08:37:57.754-05:00</updated><title type='text'>Hi Mark,

I do have a concern with global namespac...</title><summary type='text'>Hi Mark,&lt;br /&gt;&lt;br /&gt;I do have a concern with global namespace and javascript modules.&lt;br /&gt;I&amp;#39;m using your rules for my add-on, but now I want to isolate part of my code in a javascript module.&lt;br /&gt;&lt;br /&gt;So I have all my javascript code wrapped into the following object for extension QuickFileMail :&lt;br /&gt;if(!net) var net={};&lt;br /&gt;if(!net.phpconcept) net.phpconcept={};&lt;br /&gt;if(!</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/8834852852085292803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/8834852852085292803'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1283866677754#c8834852852085292803' title=''/><author><name>Vincent</name><uri>http://www.phpconcept.net</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-503957819'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-6768066652891798315</id><published>2010-09-02T21:51:22.823-05:00</published><updated>2010-09-02T21:51:22.823-05:00</updated><title type='text'>Nick:  You&amp;#39;re completely correct - using the &amp;...</title><summary type='text'>Nick:  You&amp;#39;re completely correct - using the &amp;quot;let&amp;quot; statement introduced with JavaScript 1.7 is a great alternative.  This should work great for use within Firefox extensions, but for use within web pages, the only web browser currently supporting JavaScript 1.7 is also Mozilla Firefox.&lt;br /&gt;&lt;br /&gt;However, the object namespacing approach still serves a purpose, even when &amp;quot;let&amp;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6768066652891798315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6768066652891798315'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1283482282823#c6768066652891798315' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://2.bp.blogspot.com/_aV4l4vyh5uQ/S31T85WfmMI/AAAAAAAAA9U/nRo4aI0okiQ/S220/Facebook+Me.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-8400288768645472154</id><published>2010-09-02T21:42:09.211-05:00</published><updated>2010-09-02T21:42:09.211-05:00</updated><title type='text'>Ste / gigamorph:

Regarding the &amp;quot;JavaPackage&amp;...</title><summary type='text'>Ste / gigamorph:&lt;br /&gt;&lt;br /&gt;Regarding the &amp;quot;JavaPackage&amp;quot; issues under Mozilla Rhino, please refer to &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=468385" rel="nofollow"&gt;https://bugzilla.mozilla.org/show_bug.cgi?id=468385&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As a quick work-around, one can just evaluate &amp;quot;delete&amp;quot; statements during the Rhino initialization to remove these object references, </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/8400288768645472154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/8400288768645472154'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1283481729211#c8400288768645472154' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://2.bp.blogspot.com/_aV4l4vyh5uQ/S31T85WfmMI/AAAAAAAAA9U/nRo4aI0okiQ/S220/Facebook+Me.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-7990090440131244697</id><published>2010-07-20T05:24:29.059-05:00</published><updated>2010-07-20T05:24:29.059-05:00</updated><title type='text'>Doesn&amp;#39;t using &amp;#39;let&amp;#39; rather than &amp;#39;v...</title><summary type='text'>Doesn&amp;#39;t using &amp;#39;let&amp;#39; rather than &amp;#39;var&amp;#39; in Javascript 1.7 within extensions avoid polluting the global namespace in an easier manner? see: https://developer.mozilla.org/en/new_in_javascript_1.7</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/7990090440131244697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/7990090440131244697'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1279621469059#c7990090440131244697' title=''/><author><name>Nick</name><uri>http://www.blogger.com/profile/16375008289084529344</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://1.bp.blogspot.com/_HRuNH2kqMOI/Sqrd2srWnxI/AAAAAAAABlE/fWCfgpl0FT8/S220/maldives-nick.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-496325418'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-6438442500375468828</id><published>2010-04-21T13:45:29.243-05:00</published><updated>2010-04-21T13:45:29.243-05:00</updated><title type='text'>Ste: I have the same problem.

The problem seems t...</title><summary type='text'>Ste: I have the same problem.&lt;br /&gt;&lt;br /&gt;The problem seems to be Rhino pre-defines java, com, org, net, and edu as Java packages and assumes any reference relative to them to be also a Java Package.&lt;br /&gt;&lt;br /&gt;Thus com, com.ziesemer, com.ziesemer.myPackage all evaluate as JavaPackage instead of undefined so none of the first three lines get effectively executed.&lt;br /&gt;&lt;br /&gt;It should work if you </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6438442500375468828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6438442500375468828'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1271875529243#c6438442500375468828' title=''/><author><name>gigamorph</name><uri>http://www.blogger.com/profile/14897419252527123691</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2062858027'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-6298807042902478586</id><published>2010-03-20T09:58:10.411-05:00</published><updated>2010-03-20T09:58:10.411-05:00</updated><title type='text'>Hi Mark, great article! I wonder if it is still va...</title><summary type='text'>Hi Mark, great article! I wonder if it is still valid with ECMAScript 1.6 implemention &amp;quot;Mozilla Rhino&amp;quot; 1.6 release 2.&lt;br /&gt;I cut and pasted the updated sample and I get the following error running it inside jrunscript:&lt;br /&gt;&lt;br /&gt;[ste ~] o(= jrunscript /tmp/test.js &lt;br /&gt;script error in file /tmp/test.js : sun.org.mozilla.javascript.EcmaError: TypeError: Cannot call property alertHello </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6298807042902478586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6298807042902478586'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1269097090411#c6298807042902478586' title=''/><author><name>Ste</name><uri>http://www.blogger.com/profile/04439244082106147350</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1439573326'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-7543813046110533694</id><published>2010-02-20T09:16:16.443-06:00</published><updated>2010-02-20T09:16:16.443-06:00</updated><title type='text'>Vikram - the code you posted by itself is valid, t...</title><summary type='text'>Vikram - the code you posted by itself is valid, though I assume that you would replace &amp;quot;namespace&amp;quot; with something more unique.&lt;br /&gt;&lt;br /&gt;See my response to Rez, just above your comment, as it looks like you two are having the exact same issue.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/7543813046110533694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/7543813046110533694'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1266678976443#c7543813046110533694' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://2.bp.blogspot.com/_aV4l4vyh5uQ/S31T85WfmMI/AAAAAAAAA9U/nRo4aI0okiQ/S220/Facebook+Me.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-3361232930972622494</id><published>2010-02-20T09:13:13.003-06:00</published><updated>2010-02-20T09:13:13.003-06:00</updated><title type='text'>Ravi: com.ziesemer.myfun(); Will work from anywher...</title><summary type='text'>Ravi: com.ziesemer.myfun(); Will work from anywhere, including from within any other function.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/3361232930972622494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/3361232930972622494'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1266678793003#c3361232930972622494' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://2.bp.blogspot.com/_aV4l4vyh5uQ/S31T85WfmMI/AAAAAAAAA9U/nRo4aI0okiQ/S220/Facebook+Me.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-6128609753069834774</id><published>2010-02-20T02:20:55.798-06:00</published><updated>2010-02-20T02:20:55.798-06:00</updated><title type='text'>if(!com) var com={};
if(!com.ziesemer) com.zieseme...</title><summary type='text'>if(!com) var com={};&lt;br /&gt;if(!com.ziesemer) com.ziesemer={};&lt;br /&gt;&lt;br /&gt;com.ziesemer.myPackage = function(){&lt;br /&gt;  var pub = {};&lt;br /&gt;  &lt;br /&gt;  pub.name = &amp;quot;visitor&amp;quot;;&lt;br /&gt;  pub.greeting = &amp;quot;hello &amp;quot; + pub.name;&lt;br /&gt;  pub.alertHello = function(){&lt;br /&gt;    alert(pub.greeting);&lt;br /&gt;  };&lt;br /&gt;  return pub;&lt;br /&gt;}();&lt;br /&gt;&lt;br /&gt;com.ziesemer.myfun = function()&lt;br /&gt;{&lt;br /&gt; var tst </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6128609753069834774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6128609753069834774'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1266654055798#c6128609753069834774' title=''/><author><name>Ravi</name><uri>http://www.blogger.com/profile/01948365714245658194</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-633919539'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-4998239211709400562</id><published>2009-12-30T06:42:49.193-06:00</published><updated>2009-12-30T06:42:49.193-06:00</updated><title type='text'>hello everyone !! 

I&amp;#39;m like a beginner in jav...</title><summary type='text'>hello everyone !! &lt;br /&gt;&lt;br /&gt;I&amp;#39;m like a beginner in java Script and restructuring one of my Firefox addon for global Namespacing.&lt;br /&gt;&lt;br /&gt;------------------&lt;br /&gt;var namespace = new function() {&lt;br /&gt;    return {&lt;br /&gt;            i: 0,&lt;br /&gt;     var: &amp;#39;bar&amp;#39;,&lt;br /&gt; &lt;br /&gt;      function1: function(){ &lt;br /&gt;      alert(&amp;quot;inside function 1&amp;quot;); &lt;br /&gt;      namespace.function2();</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/4998239211709400562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/4998239211709400562'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1262176969193#c4998239211709400562' title=''/><author><name>Vikram Baghel</name><uri>http://www.blogger.com/profile/00805511834102909968</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11224055018310034270'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_Wa7elN8QFQ0/Sqx4NyYKiiI/AAAAAAAAApo/klnC1rV1AoU/S220/Image054.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-801254934'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-9131689419651204097</id><published>2009-07-28T12:34:51.954-05:00</published><updated>2009-07-28T12:34:51.954-05:00</updated><title type='text'>Rez - it&amp;#39;s difficult to provide a complete ans...</title><summary type='text'>Rez - it&amp;#39;s difficult to provide a complete answer without being able to view the complete extension, but it sounds like you&amp;#39;re working with 2 separate scopes (possibly different windows or frames), or that your .js file is not being loaded.  If you use the steps and debugging tools listed at &lt;a href="https://developer.mozilla.org/en/Building_an_Extension" rel="nofollow"&gt;https://</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/9131689419651204097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/9131689419651204097'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1248802491954#c9131689419651204097' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_aV4l4vyh5uQ/ShtLaqsYJkI/AAAAAAAAAkQ/eB_MTM01zSo/S220/n502931492_6934_6270.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-4832587488356063036</id><published>2009-07-15T23:22:58.782-05:00</published><updated>2009-07-15T23:22:58.782-05:00</updated><title type='text'>Hey Mark,

Thanks for the article! 

I am currentl...</title><summary type='text'>Hey Mark,&lt;br /&gt;&lt;br /&gt;Thanks for the article! &lt;br /&gt;&lt;br /&gt;I am currently re-writing an extension of mine to have it moved from the sandbox. I had a couple of functions in my JS file doing certain tasks and now I tried doing the following:&lt;br /&gt;&lt;br /&gt;if(!com) var com={};&lt;br /&gt;if(!com.hottypo) com.hottypo={};&lt;br /&gt;if(!com.hottypo.myPackage) com.hottypo.myPackage={};&lt;br /&gt;&lt;br /&gt;com.hottypo.myPackage </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/4832587488356063036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/4832587488356063036'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1247718178782#c4832587488356063036' title=''/><author><name>Rez</name><uri>http://www.blogger.com/profile/09565308071521818623</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1463302960'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-8934479781013191165</id><published>2009-06-28T12:44:04.370-05:00</published><updated>2009-06-28T12:44:04.370-05:00</updated><title type='text'>Jaap - have you tried removing &amp;quot;this.&amp;quot;, ...</title><summary type='text'>Jaap - have you tried removing &amp;quot;this.&amp;quot;, and just referencing &amp;quot;_member_variable&amp;quot;?&lt;br /&gt;&lt;br /&gt;If there is a naming-conflict with another variable in a function closer in the scope chain, you could access the inner variable as fully-qualified, e.g. org.mozdev.dictionarysearch._member_variable.&lt;br /&gt;&lt;br /&gt;I&amp;#39;d also recommend writing the object as a function with a closure, </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/8934479781013191165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/8934479781013191165'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1246211044370#c8934479781013191165' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/_aV4l4vyh5uQ/ShtLaqsYJkI/AAAAAAAAAkQ/eB_MTM01zSo/S220/n502931492_6934_6270.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-4532475099537758372</id><published>2009-06-28T12:09:37.829-05:00</published><updated>2009-06-28T12:09:37.829-05:00</updated><title type='text'>Hi,

I got an email from mozilla addons that I nee...</title><summary type='text'>Hi,&lt;br /&gt;&lt;br /&gt;I got an email from mozilla addons that I need to wrap my variables and functions in the way you suggest. However it does not seem to work because the &amp;quot;this&amp;quot; variable is not pointing to the object I defined but to a chrome window. See the example below&lt;br /&gt;&lt;br /&gt;What should I do to correct this?&lt;br /&gt;&lt;br /&gt;function debug (str) {&lt;br /&gt;    consoleService = </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/4532475099537758372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/4532475099537758372'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1246208977829#c4532475099537758372' title=''/><author><name>Jaap</name><uri>http://jaap.haitsma.org/</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11271708784241787736'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/openid16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-91172900'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-1685776654390032270</id><published>2009-04-28T14:06:00.000-05:00</published><updated>2009-04-28T14:06:00.000-05:00</updated><title type='text'>I wrote an article regarding the &lt;a href="http://w...</title><summary type='text'>I wrote an article regarding the &lt;A HREF="http://www.louddog.com/bloggity/2009/04/the-importance-of-namespace.php" REL="nofollow"&gt;importance of namespacing&lt;/A&gt; in JavaScript.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/1685776654390032270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/1685776654390032270'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1240945560000#c1685776654390032270' title=''/><author><name>Matt DeClaire</name><uri>http://www.louddog.com</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2091815244'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-6884412603020334820</id><published>2009-04-16T11:53:00.000-05:00</published><updated>2009-04-16T11:53:00.000-05:00</updated><title type='text'>Thanks, Mark. I believe I understand now.  We can ...</title><summary type='text'>Thanks, Mark. I believe I understand now.  We can set up the base of the namespace in file1 and then extend the namespace in file2 or even add more functions to the original namespace.  I like this method. Great job. Thanks for your assistance.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6884412603020334820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6884412603020334820'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1239900780000#c6884412603020334820' title=''/><author><name>Vinny2020</name><uri>http://www.blogger.com/profile/05644045433649933896</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-183503218'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-5718165780579088566</id><published>2009-04-16T10:43:00.000-05:00</published><updated>2009-04-16T10:43:00.000-05:00</updated><title type='text'>Vinny2020 - First, we should use something like my...</title><summary type='text'>Vinny2020 - First, we should use something like my &lt;A HREF="/2008/05/javascript-namespace-function.html" REL="nofollow"&gt;JavaScript namespace function&lt;/A&gt; to declare the namespaces so that each level is only added when necessary, without overwriting anything.&lt;br /&gt;&lt;br /&gt;Using this, assume in the first file:&lt;br /&gt;&lt;br /&gt;&amp;quot;com.example&amp;quot;.namespace().a = function(){...};&lt;br /&gt;&amp;quot;com.example&amp;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/5718165780579088566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/5718165780579088566'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1239896580000#c5718165780579088566' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://profile.ak.facebook.com/profile2/436/88/s502931492_26012.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-6152012199200151678</id><published>2009-04-16T09:56:00.000-05:00</published><updated>2009-04-16T09:56:00.000-05:00</updated><title type='text'>Mark, yes that will work, but in the additional ja...</title><summary type='text'>Mark, yes that will work, but in the additional javascript files how would I define the function? Would I have to use the whole package name? If I redefine the initial "package" function in file 2, that will blow away anything created in file 1.  So after the initial definition in file 1, do I then use the full "namespace" to define functions in file 2"?&lt;br /&gt;&lt;br /&gt;Using your example, in file 2 </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6152012199200151678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6152012199200151678'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1239893760000#c6152012199200151678' title=''/><author><name>Vinny2020</name><uri>http://www.blogger.com/profile/05644045433649933896</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-183503218'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-1250023303744890329</id><published>2009-04-15T18:49:00.000-05:00</published><updated>2009-04-15T18:49:00.000-05:00</updated><title type='text'>Vinny2020 - it really doesn&amp;#39;t matter.  Whether...</title><summary type='text'>Vinny2020 - it really doesn&amp;#39;t matter.  Whether it is a &amp;quot;sub-domain&amp;quot; or a function within a &amp;quot;domain&amp;quot;, they are both accessed through the same dot-notation.  So you could start out by declaring one &amp;quot;package&amp;quot; with various sub-packages and functions in your first source file.  In each additional source file, you could add additional sub-packages and/or functions.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/1250023303744890329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/1250023303744890329'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1239839340000#c1250023303744890329' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://profile.ak.facebook.com/profile2/436/88/s502931492_26012.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-990759828207381351</id><published>2009-04-15T13:48:00.000-05:00</published><updated>2009-04-15T13:48:00.000-05:00</updated><title type='text'>I like this technique.  However I am wondering, ho...</title><summary type='text'>I like this technique.  However I am wondering, how would you use your method to encapsulate 3 javascript source files, but still have them as the same "package"?&lt;br /&gt;&lt;br /&gt;I'm sure I could do it by adding another "sub domain" to the dot-notation, but what if I want them all to have the same "domain"?</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/990759828207381351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/990759828207381351'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1239821280000#c990759828207381351' title=''/><author><name>Vinny2020</name><uri>http://www.blogger.com/profile/05644045433649933896</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-183503218'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-6039494346012822749</id><published>2009-03-27T08:24:00.000-05:00</published><updated>2009-03-27T08:24:00.000-05:00</updated><title type='text'>Anonymous - I guess that is why I didn't recommend...</title><summary type='text'>Anonymous - I guess that is why I didn't recommend it.  I'm removing it from the post as it is incorrect.</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6039494346012822749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6039494346012822749'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1238160240000#c6039494346012822749' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://profile.ak.facebook.com/profile2/436/88/s502931492_26012.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-6210929723093088713</id><published>2009-03-26T22:26:00.000-05:00</published><updated>2009-03-26T22:26:00.000-05:00</updated><title type='text'>The code you provided:&lt;br&gt;&lt;br&gt;if(!com) var com={};...</title><summary type='text'>The code you provided:&lt;BR/&gt;&lt;BR/&gt;if(!com) var com={};&lt;BR/&gt;if(!com.ziesemer) com.ziesemer={};&lt;BR/&gt;if(!com.ziesemer.myPackage) com.ziesemer.myPackage={};&lt;BR/&gt;&lt;BR/&gt;with(com.ziesemer.myPackage){&lt;BR/&gt;  name = "visitor";&lt;BR/&gt;  greeting = "hello " + name;&lt;BR/&gt;  alertHello = function(){&lt;BR/&gt;    alert(greeting);&lt;BR/&gt;  }&lt;BR/&gt;}&lt;BR/&gt;&lt;BR/&gt;com.ziesemer.myPackage.alertHello();&lt;BR/&gt;&lt;BR/&gt;throws an error when </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6210929723093088713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/6210929723093088713'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1238124360000#c6210929723093088713' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1405510065'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-1742961149926936057</id><published>2009-01-24T15:04:00.000-06:00</published><updated>2009-01-24T15:04:00.000-06:00</updated><title type='text'>Ryan - I don&amp;#39;t know, especially without seeing...</title><summary type='text'>Ryan - I don&amp;#39;t know, especially without seeing more details.  Just check for typos, etc.  The code is definitely correct.&lt;BR/&gt;&lt;BR/&gt;Claudijo - I&amp;#39;d have to say that this and the extensions windows are two different issues.  The main goal behind this post is simply managing the namespace of a given scope.  Your issue with the different extension windows is working across different scopes.&lt;BR</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/1742961149926936057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/1742961149926936057'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1232831040000#c1742961149926936057' title=''/><author><name>Mark A. Ziesemer</name><uri>http://www.blogger.com/profile/12752422620777325409</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='03040793697038588204'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://profile.ak.facebook.com/profile2/436/88/s502931492_26012.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-143408883'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-5944348867417954950</id><published>2009-01-24T12:24:00.000-06:00</published><updated>2009-01-24T12:24:00.000-06:00</updated><title type='text'>Thanks for a good reference. &lt;br&gt;&lt;br&gt;As a novice j...</title><summary type='text'>Thanks for a good reference. &lt;BR/&gt;&lt;BR/&gt;As a novice javascript programmer and extension developer I have a question. How is the problem with loose variables exploited (or even used as a positive side effect)? &lt;BR/&gt;&lt;BR/&gt;As far as I know, It is not sufficient to make a variabel global in the overlay file in order to access it from a javascript loaded in the firefox sidebar (instead I have to do </summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/5944348867417954950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/5944348867417954950'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1232821440000#c5944348867417954950' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2122362432'/></entry><entry><id>tag:blogger.com,1999:blog-4222197394079314848.post-4164870710859743494</id><published>2009-01-23T20:34:00.000-06:00</published><updated>2009-01-23T20:34:00.000-06:00</updated><title type='text'>Hi Mark,&lt;br&gt;&lt;br&gt;I am using the code you recommende...</title><summary type='text'>Hi Mark,&lt;BR/&gt;&lt;BR/&gt;I am using the code you recommended for Firefox extension, as below:&lt;BR/&gt;&lt;BR/&gt;if(!com) var com={};&lt;BR/&gt;if(!com.ziesemer) com.ziesemer={};&lt;BR/&gt;com.ziesemer.myPackage = function(){};&lt;BR/&gt;&lt;BR/&gt;and I include this .js file in the main XUL file, and then it generates an error in the error console:&lt;BR/&gt;invalid assignment left-hand side:&lt;BR/&gt;com.ziesemer.myPackage = function(){};&lt;BR/&gt;&lt;</summary><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/4164870710859743494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222197394079314848/7529161154058402421/comments/default/4164870710859743494'/><link rel='alternate' type='text/html' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html?showComment=1232764440000#c4164870710859743494' title=''/><author><name>ryan</name><uri>http://www.blogger.com/profile/09137525864923529023</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blogger.ziesemer.com/2007/10/respecting-javascript-global-namespace.html' ref='tag:blogger.com,1999:blog-4222197394079314848.post-7529161154058402421' source='http://www.blogger.com/feeds/4222197394079314848/posts/default/7529161154058402421' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1196957687'/></entry></feed>
