469,590 Members | 2,312 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,590 developers. It's quick & easy.

Subwindow title bar

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
Jul 23 '05 #1
2 1818
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

Jul 23 '05 #2
On 16 Apr 2004 18:08:40 -0700, David <da*********@wdsrc.com> wrote:

[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.

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Don Grover | last post: by
1 post views Thread by Venkat | last post: by
1 post views Thread by Marcel | last post: by
6 posts views Thread by Wolf Grossi | last post: by
1 post views Thread by Wolf Grossi | last post: by
5 posts views Thread by digory | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.