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
pm******@houston.rr.com (Paul Moffitt) wrote in message news:<c4**************************@posting.google. com>...
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[i].checked)
var doc = escape(document.forms[0].EDoc[i].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,menu bar=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