Works great, thank you!

--- Konstantin Svist <[EMAIL PROTECTED]> wrote:

> one way is to include both files, in correct order, from container (like 
> an HTML file). The trick is, both files appear in global scope, so 2nd 
> one should see the defs of the 1st one (but not the other way around)
> 
> <script type="text/javascript" src="a.js"> <!-- defines foxyproxy -->
> <script type="text/javascript" src="b.js"> <!-- uses foxyproxy -->
> 
> 
> the other way is to use XmlHttpRequest to retrieve source of a.js while 
> running b.js (and then eval source of a.js). Of course, usual caveats 
> with using eval apply.
> 
> HTH
> 
> Eric H. Jung wrote:
> > Hi,
> > 
> > In file a.js, I define:
> > 
> >   var foxyproxy = {...};
> > 
> > In file b.js, I'd like to define:
> > 
> >   foxyproxy.foo = function() { ... };
> > 
> > but this yields a "foxyproxy is not defined" error in b.js. Is there anyway 
> > to do this in
> separate
> > files?
> > 
> > Thanks,
> > Eric Jung
> > _______________________________________________
> > Project_owners mailing list
> > [email protected]
> > http://mozdev.org/mailman/listinfo/project_owners
> > 
> _______________________________________________
> Project_owners mailing list
> [email protected]
> http://mozdev.org/mailman/listinfo/project_owners
> 

_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to