Connecting Tech Pros Worldwide Help | Site Map

Javascript error conflict between separate classes

Member
 
Join Date: May 2007
Posts: 42
#1: Aug 28 '08
I have been working on this for some time and I came to the conclusion that I have no idea what is the problem,

I am sure it should be something simple that I am overlooking, but I can't figure where,

I have written some classes to load the google map using google map API and a grid using extjs,

here is the page :
http://tinyurl.com/5clr49

and here is the classes:
http://tinyurl.com/6ryng5

no problem here, everything works fine and no issues,

first I will explain what is going on:

variables are set in "pxxx_map_set" and "pxxx_grid_set" (xxx=228),

after the calss object is created :
Expand|Select|Wrap|Line Numbers
  1.  var pxxx_Google_Grid = new pxxx_Google_Grid_UI; 
  2.  var pxxx_Google_Map = new pxxx_Google_Map_UI;
  3.  
those variables are sent to this object with "init" function :
Expand|Select|Wrap|Line Numbers
  1.  Ext.onReady(function(){pxxx_Google_Grid.init(pxxx_grid_set,pxxx_Google_Map);}, pxxx_Google_Grid, true);
  2.  window.setTimeout(function(e) {pxxx_Google_Map.init(pxxx_map_set,pxxx_Google_Grid)},'0');
  3.  
no problem here,

now here is another clone with different "xxx" (2000) name:
http://tinyurl.com/59ghs3

the script is exactly the same,

that one also works fine,

now if you put them together :
http://tinyurl.com/6zby37

errors start appearing:
Expand|Select|Wrap|Line Numbers
  1. v is undefined
at first I had the two of the pages create an instance of the same class name and I thought maybe there is a conflict,
but later on when I gave each of the page it's own separate class:

first page (xxx=228):
pxxx_Google_Map_UI()
and
pxxx_Google_Grid_UI ()

and 2nd page (xxx=2000):
pxxx_Google_Map_UI()
and
pxxx_Google_Grid_UI ()

Now I can not understand why these 2 are conflicting.

ps.
"v" is set through "init" from "pxxx_map_set.v"

I just cant figure out where is my mistake,
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Sep 26 '08

re: Javascript error conflict between separate classes


There doesn't seem to be any errors, so I guess this has been solved. Does make sense, I suppose, when you consider it's been a month since you posted ;)
Reply