Subwindow title bar

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Moffitt

    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("La unchEDoc.asp?ED oc=" + doc, "_blank",
    "toolbar=0,dire ctories=no,loca tion=0,status=0 ,menubar=0,scro llbars=1,resiza ble
    =1, width=950, height=580, left=0px, top=100px")

    if(subWindow.op ener) {

    subWindow.opene r = window

    }

    subWindow.focus ()

    }

    Thank you

    Paul Moffitt
  • David

    #2
    Re: Subwindow title bar

    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?t itle="+doc+"&sr c=/LaunchEDoc.asp? EDoc="+doc+"_bl ank"...

    Then docloader.asp, or whatever you want to call it, would be a simple
    frame or iframe page, such as:
    <title><%=reque st("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

    pmoffitt@housto n.rr.com (Paul Moffitt) wrote in message news:<c4e507bc. 0404161006.1612 1693@posting.go ogle.com>...[color=blue]
    > 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("La unchEDoc.asp?ED oc=" + doc, "_blank",
    > "toolbar=0,dire ctories=no,loca tion=0,status=0 ,menubar=0,scro llbars=1,resiza ble
    > =1, width=950, height=580, left=0px, top=100px")
    >
    > if(subWindow.op ener) {
    >
    > subWindow.opene r = window
    >
    > }
    >
    > subWindow.focus ()
    >
    > }
    >
    > Thank you
    >
    > Paul Moffitt[/color]

    Comment

    • Michael Winter

      #3
      Re: Subwindow title bar

      On 16 Apr 2004 18:08:40 -0700, David <davidsheets@wd src.com> wrote:

      [snipped top-post]
      [color=blue]
      > 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.[/color]

      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.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

      Comment

      Working...