leftpeg
06-16-2004, 01:29 PM
Hello,
I have a select box which onChange calls a function which sets the current URL using document.URL. Within that function I want to refer to a div in the new document but the div doesn't appear to exist even though I know it does. I also want to call javascript functions which belong to the new document but don't exist in the calling document.If I do
function getNewDocument(){
document.URL = "http://myserver/index.cfm";
alert(document.URL) ;
alert(document.getElementById("top"));
}
the 1st alert returns the URL of the document which contains the select box. the 2nd alert returns null, because there is no "top" in the original document.
How can I make document.URL take effect immediately?
Thanks.
I have a select box which onChange calls a function which sets the current URL using document.URL. Within that function I want to refer to a div in the new document but the div doesn't appear to exist even though I know it does. I also want to call javascript functions which belong to the new document but don't exist in the calling document.If I do
function getNewDocument(){
document.URL = "http://myserver/index.cfm";
alert(document.URL) ;
alert(document.getElementById("top"));
}
the 1st alert returns the URL of the document which contains the select box. the 2nd alert returns null, because there is no "top" in the original document.
How can I make document.URL take effect immediately?
Thanks.