opening a child window and setting the title causes a unspecifed javascript error
see the code below - i want to open a new window but hide the virtual file path from users, the code only has to work in IE5.
The code works in Homesite but generates a unspecified error and did not work in the browser.
Any help is much appreciated
<script language="JavaScript">
<!--
function open_popup(page) {
var myWindow = window.open(page,'test','width=200,height=200');
myWindow.document.title = 'testpage';
return false;
}
//-->
</script>
I have the same problem! I would like to change the window's title after it's been opened but I get the error. Is there any way to do this? Maybe there is a work around this?
What if you put:
<script LANGUAGE="JavaScript"><!--
window.title = 'testpage';
//--></script>
or
<script LANGUAGE="JavaScript"><!--
document.title = 'testpage';
//--></script>
between the <HEAD> tags of your pop up window?
Or in script that gets executed onload of the pop up window?
(Incidentally, the example you gave worked fine as it was in IE6.)
thanks for replying but that code isn't appropriate. I'm opening a word / excel doc that obviously does not contain any HTML tags, that's why I'm trying to change the title using this method.
Thanks for the information regarding IE6 unfortunately this has to work in IE5.
Bookmarks