New to Javascript, couple of weeks now. Here is what I am trying to do.
If I take the code from tempLoad and put it inCode:MapObj=new Object (); //VARIOUS ATTRIBUTES MapObj.map; //This what I have problems with latter on MapObj.MyInt=65; //... //VARIOUS METHODS //... MapObj.initMap=initMap; MapObj.tempLoad=tempLoad; //All the stuff in here works function initMap (strContainerID, numLatitude, numLongitude) { MapObj.map = new FromVendorLib.Map(strContainerID); MapObj.map.centerIt(MoreStuff); MapObj.map.controls(AndMoreStuff); } //So now I assume MapObj.map holds what I need, but //Now I crash at MapObj.map. function tempLoad() { // All kinds of other stuff var SomeVar = new AnotherVendorThing.Thing(MapObj.map, { someParameter : 40 } ); }
initMap everything is fine. However I really want to keep my
initialization and loading separate. So I assume I am missing
a fundamental concept with scope and objects. Please educate me.
Thank You


Reply With Quote
Bookmarks