I created a window using
var win = window.open(URL, name, features) ;
tried to do
win.document.title = 'new title' ;
got javascript 'Unspecified error'
How am I suppose to change the title in javascript???
It should work, what "features" have you specified?
Garadon
03-19-2004, 08:12 PM
Possible fault is that you try and set the title before the document has loaded. Note I have never really tampered with popups so is just a guess.
requestcode
03-19-2004, 08:13 PM
That feature does not work in any of the Mozilla browsers. You can only reference the document.title.
Choopernickel
03-19-2004, 08:23 PM
Give this a shot:
try {
// should work w/ IE
win.document.title = 'new title';
} catch (err) {
try {
// should work with Gecko
win.defaultView.documentElement.title = 'new title';
} catch (err2) {
alert('I cannot set the title.');
}
}
Sorry, forgot to close the tag.
unfortunately, I'm running currently on IE6. I'll try to delay the win.document.title and see if that works.
Choopernickel
03-19-2004, 09:33 PM
Okay, if that won't work period, try this.
win = window.open(...);
win.setTitle = setTitle;
win.onload = function () {
document.title = 'new title';
}
Maybe that'll work?