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 

Tree link-frames problem

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    JavaScript.CoolDev.Com Forum Index -> COOLjsTree
Author Message
cbtree



Joined: 16 Jul 2007
Posts: 6

PostPosted: Mon Jul 16, 2007 10:15 am    Post subject: Tree link-frames problem Reply with quote

Hy all,
I have COOLjsTree Standard - it's ok for what i need but the problem is that i don't understand how to make the links load in a right frame.

I have put the menu in a left frame inside a <div> - i'm making table-free websites using css and that's why i use div's.

In my tree_nodes.js file i have this:

["About", 'page.html', 'frame3.html'],

Now when i click the About link, the page.html doesn't load in the frame3.html. It opens a new window with it!
I've searched this forum and i see the same thing to write in the tree_nodes.js file - why isn't working?

Thank you
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Mon Jul 16, 2007 10:57 am    Post subject: Reply with quote

It tries to locate frame with name "frame3.html" (i.e. <iframe name="frame3.html"> or <frame name="frame3.html">), but fails to do this, and then creates new window. This is standard behavior since midages.

Make sure that third parameter of node matches your frame's name. E.g.:
Code:
var TREE_NODES = [
    ['Node 1', 'file.html', 'myFrame']
];

...

<iframe name="myFrame"></iframe>
Back to top
cbtree



Joined: 16 Jul 2007
Posts: 6

PostPosted: Mon Jul 16, 2007 11:11 am    Post subject: Reply with quote

Thank you for the answer - i must be stupid really because i don't get it.
In my frameset page i have this:

<frameset rows="*" cols="239,636" frameborder="no">
<frame src="Untitled-1.html" frameborder="no" scrolling="no" noresize="noresize">
<frame src="frame3.html" frameborder="no" scrolling="no" noresize="noresize">
</frameset>


And in tree_nodes.js i have this:

['Button', 'pagetoloadinframe3.html', 'frame3.html'
],


I don't get it Crying or Very sad
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Mon Jul 16, 2007 11:28 am    Post subject: Reply with quote

src="..." specifies which file to load into frame. name="..." (your sample does not have it) specifies name of the frame, and other parts of the page can use this name to load some URL into that frame.

So, change your code:
Quote:
<frameset rows="*" cols="239,636" frameborder="no">
<frame src="Untitled-1.html" frameborder="no" scrolling="no" noresize="noresize">
<frame src="frame3.html" name="content" frameborder="no" scrolling="no" noresize="noresize">
</frameset>

...

['Button', 'pagetoloadinframe3.html', 'content'],


More info about frames can be found here: http://www.w3.org/TR/html401/present/frames.html.
Back to top
cbtree



Joined: 16 Jul 2007
Posts: 6

PostPosted: Mon Jul 16, 2007 11:37 am    Post subject: Reply with quote

OMG i knew i'm an idiot Embarassed
THANK YOU SO MUCH MAN!!!
Back to top
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    JavaScript.CoolDev.Com Forum Index -> COOLjsTree All times are GMT
Page 1 of 1