Changing the TITLE on a popup window

I know that to change/add a message to the TITLE bar on the browser you have to use document.title, but, if you window.open I think you can’t.

The reason to this is because on the popup window it shows the url and the page name, somethng like http://www.MySite.com - Input Data - Microsoft Internet Explorer and I don’t want the url to show up.

Am I missing something?

Nope.

You can change the title in a popup window from the main window.

var newwin = window.open(…
newwin.document.title = “new title”;

The url that appears in front of the title is put there by the browser as a security measure. It can be removed by disabling some security options in the browser but that cannot be done from the web page (as it would be a security breach).

I ahve been searching for a way to change a title on a pop-up and I would like to use this but is there a way to embed this code within ASP?

Thanks

Even if you window.open you can still set the <TITLE> attribute in the opened window.

But for some reason, the title in the document I am opening is being over-ridden with the address.

Did you check the HTML code in the opened window? Maybe the <TITLE> attribute is not in the right place or something.

Yes, everything is in the proper areas.

Hmmmm … well doing something like

<script>window.onload = self.focus;document.title = “My title”;</script>
should work.

However as felgall said the URL is placed there by the browser.

Yeah, I tried that and still no luck. I am going to see if there is a way to override the browser input.

Thanks for trying.

Nick

The title is only a part of what goes in the bar at the top of the browser window. The browser itself will put other things there such as the name of the browser, the address of the current page and/or the size of the window. These other pieces may be able to be changed by changing your browser settings but they cannot be changed by the web page which only has access to the title portion of what is displayed.