one.jsnamespace("package1")
package1.tabs=function(app){this.app = app;this. createTabs();}createTabs = function(){oneObject = new thirdpartyObject();}two.js//Here I have to access oneObject.
> Here I have to access oneObject.You can't, it's a local variable within the function you assigned to the `createTabs` variable. Unless you export it (make it publicly accessible in some way, for instance by assigning it to your `package1` object as a property), it's completely private to `createTabs`.Side note: Your code is falling prey to The Horror of Implicit Globals[1]. Strongly recommend properly declaring variables to avoid that.--T.J. CrowderIndependent Software Engineertj / crowder software / comwww / crowder software / comOn Sunday, 1 April 2012 12:41:16 UTC+1, nav indian wrote:HiI have two javascript files.one.jsnamespace("package1")
package1.tabs=function(app){this.app = app;this. createTabs();}createTabs = function(){oneObject = new thirdpartyObject();}two.js//Here I have to access oneObject.--To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/XJ20PmyWnIQJ.
You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
To post to this group, send email to prototype-s...@googlegroups.com.
To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to prototype-scriptaculous+unsub...@googlegroups.com.