Subwindow title bar

P

Paul Moffitt

We have a Javascript function that opens an electronic document in a
subwindow. The Title bar of the subwindow shows the filepath of the
document. Looking at the script below is there any way to add script
to the function to either not show the path in the title bar or
replace the path with other text?

function launchEDoc() {
var subWindow
window.document.title = "InSight"
if (document.forms[0].EDoc.length){
for (var i = 0; i < document.forms[0].EDoc.length; i++)
if (document.forms[0].EDoc.checked)
var doc = escape(document.forms[0].EDoc.value)
}else{
var doc = escape(document.forms[0].EDoc.value)
}
subWindow = window.open("LaunchEDoc.asp?EDoc=" + doc, "_blank",
"toolbar=0,directories=no,location=0,status=0,menubar=0,scrollbars=1,resizable
=1, width=950, height=580, left=0px, top=100px")

if(subWindow.opener) {

subWindow.opener = window

}

subWindow.focus()

}

Thank you

Paul Moffitt
 
D

David

document.title is read only, so there is NO WAY to change it after the
page posts with javascript, or anything else for that matter...as far
as I know. You have to do it during load.

My suggestion is to create a frame or iframe page, that accepts your
documents as a parameter, along with whatever you want your title to
say.

For example, change your window.open to start like this:
window.open("/docloader.asp?title="+doc+"&src=/LaunchEDoc.asp?EDoc="+doc+"_blank"...

Then docloader.asp, or whatever you want to call it, would be a simple
frame or iframe page, such as:
<title><%=request("TITLE")%></title>
<body topmargin="0" leftmargin="0">
<iframe src="<%=request("SRC")%>" width="100%" height="100%"
frameborder="1"></iframe>

Then when the window opens, it will have your document in it, and the
title bar will be whatever you passed it in your window.open
statement.


David
 
M

Michael Winter

[snipped top-post]
document.title is read only, so there is NO WAY to change it after the
page posts with javascript, or anything else for that matter...as far
as I know. You have to do it during load.

That's not true anymore. Whilst earlier versions of JavaScript marked
document.title read-only, recent browsers allow it to be altered. This is
reflected in the W3C DOM 1 HTML Specification and Microsoft's DHTML
Reference[1].

Mike


[1] Netscape's latest documentation does not list the document host
object, so I can't cite its support. However, Mozilla will change document
titles, so one can assume that it's allowed on Mozilla-based browsers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top