Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old August 28th, 2008, 07:08 AM
Member
 
Join Date: May 2007
Posts: 42
Default Javascript error conflict between separate classes

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,
Reply
  #2  
Old September 26th, 2008, 03:24 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,964
Default

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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.