JavaScript.CoolDev.Com Support Forums

Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

cooljstree in two frames

 
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsTree
Author Message
tylerp



Joined: 19 Jun 2006
Posts: 1

PostPosted: Mon Jun 19, 2006 8:35 pm    Post subject: cooljstree in two frames Reply with quote

Hi,

I'm evaluating cooljstree. I have a frameset with a tree defined in one frame and content in another. When I load the frameset, I use the content page to select an item in the tree in the other frame.

In Firefox this works just fine. However, in IE I (intermittently) get an error saying that the variable (the tree) is not defined. I think this is because the frames are being loaded asynchronously.

I tried using parent.tree.document.readyState, and this works fine in IE. However, it doesn't work for Firefox, and I want to be cross-platform.

Does anyone know how to cause the content frame to wait until the tree has been defined before calling methods on it?

Thanks!

Tyler
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Thu Jun 22, 2006 3:18 pm    Post subject: Reply with quote

In the frame with the tree you can store reference to tree object into global variable:

Code:
window.myTree = tree1; // or whatever


Then in the other frame before trying to reach the tree, you can check if first frame is fully loaded:

Code:
if (top.frames.firstFrame && top.frames.firstFrame.tree1) { /* do some stuff here */ }
Back to top
Display posts from previous:   
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsTree All times are GMT
Page 1 of 1