PDA

View Full Version : javascript redirection to <DIV>


motiveco
07-17-2002, 12:39 AM
Does anyone have an answer to this?
I am having problems getting a hyperlink to redirect from a floating javascript menu bar into a <DIV> location within the same page. I thought the code, javascript:parent.framename.location='http://mysite.com', could be inserted into the empty quotes following "Introduction" like such:
dhtmlMenu = new NavBarMenu(100, 120);
dhtmlMenu.addItem(new NavBarMenuItem("Introduction", "javascript:parent.framename.location='http://mysite.com'"));
but this doesn't load the page properly.
Please help!
Kyle

ACJavascript
07-17-2002, 01:09 AM
you can't load a new page into a div, i think your thinking of iframes, try an iframe instead of a div :thumbsup:

motiveco
07-17-2002, 08:55 AM
One further question regarding iframes...due to the fact that javascript is loaded in the body, how can I keep the javascript menu bar and still redirect within the page?

motiveco
07-17-2002, 09:03 AM
I meant to say loaded in the head of the document.

motiveco
07-17-2002, 01:37 PM
Okay, I have the menu bar free floating without error. Now, how do I pass a URL from an iframe (name="main") to the setTimeout function so that when the window reloads due to browser resizing the page remains displayed?

Here's the .js code:


if (isMinIE4)
setTimeout('window.location.href = window.location.href', 2000);
else
window.location.href = window.location.href;

Thanks,
k

ACJavascript
07-17-2002, 07:38 PM
you mean, when you click a link say in the iframe the page outside the iframe changes but the iframe stays the same?

is that what ya mean:D:D:D?