Help with popup window title

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

    #1

    Help with popup window title

    Im using the code below to pop up a window: It works fine except for that in
    the titlebar, my domain name is listed before the page title like below:

    http://mydomain.com - MyPopupwindowna me - Microsoft Internet Explorer

    Is there any way to remove this or otherwise control what is displayed in
    the titlebar? I just want it to display the page title - thats it. I dont
    really care about the MSIE but I mainly dont want the domain to display.

    Thanks in advance!

    <SCRIPT LANGUAGE="JavaS cript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL , '" + id + "',
    'toolbar=0,scro llbars=1,locati on=0,statusbar= 0,menubar=0,res izable=1,width= 520,height=500, left
    = 245,top = 262');");
    }
    // End -->
    </script>


    <a href="javascrip t:popUp('MyWind ow.asp')">Click Here</a>



  • Randy Webb

    #2
    Re: Help with popup window title

    Targa wrote:
    [color=blue]
    > Im using the code below to pop up a window: It works fine except for that in
    > the titlebar, my domain name is listed before the page title like below:
    >
    > http://mydomain.com - MyPopupwindowna me - Microsoft Internet Explorer
    >
    > Is there any way to remove this or otherwise control what is displayed in
    > the titlebar? I just want it to display the page title - thats it. I dont
    > really care about the MSIE but I mainly dont want the domain to display.[/color]

    I don't get that behavior in IE6 SP2 with your code.
    [color=blue]
    > Thanks in advance!
    >
    > <SCRIPT LANGUAGE="JavaS cript">[/color]

    <script type="text/javascript">

    The type attribute is mandatory in HTML4, and the language attribute is
    deprecated.
    [color=blue]
    > <!-- Begin[/color]

    Script hiding is no longer needed.
    [color=blue]
    > function popUp(URL) {
    > day = new Date();
    > id = day.getTime();[/color]

    So far, iffy. But its getting worse faster.
    [color=blue]
    > eval("page" + id + " = window.open(URL , '" + id + "',
    > 'toolbar=0,scro llbars=1,locati on=0,statusbar= 0,menubar=0,res izable=1,width= 520,height=500, left
    > = 245,top = 262');");[/color]

    Two problems with that line of code:

    1) The un-needed eval.



    The only purpose I can think of to do what you are trying to do is to
    ensure you have a unique window by giving it a unique window name. The
    variable "page" + id can be generated using window["page" + id]

    2) The attributes section of the window.open call (the third parameter)
    can not contain spaces.

    And a note:

    Any attribute that is set to its default setting can be omitted in the
    parameters. You don't have to specify resizable=1.

    What you end up with is this:

    window["page" + id] = window.open(URL , id, 'parameters here')

    [color=blue]
    > }
    > // End -->[/color]

    Script hiding is no longer needed.
    [color=blue]
    > </script>
    >
    >
    > <a href="javascrip t:popUp('MyWind ow.asp')">Click Here</a>[/color]

    Read the FAQ, section 4.24




    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    • DU

      #3
      Re: Help with popup window title

      Randy Webb wrote:
      [snipped]
      [color=blue]
      >[color=green]
      >> eval("page" + id + " = window.open(URL , '" + id + "',
      >> 'toolbar=0,scro llbars=1,locati on=0,statusbar= 0,menubar=0,res izable=1,width= 520,height=500, left
      >> = 245,top = 262');");[/color]
      >[/color]

      [snipped]
      [color=blue]
      > And a note:
      >
      > Any attribute that is set to its default setting can be omitted in the
      > parameters. You don't have to specify resizable=1.
      >[/color]

      On the contrary. He has to if/since there is a non-empty windowFeatures
      string.
      "When the sFeatures parameter is specified, the features that are not
      defined in the parameter are disabled."
      http://msdn.microsoft.com/workshop/a...ods/open_0.asp
      [color=blue]
      > What you end up with is this:
      >
      > window["page" + id] = window.open(URL , id, 'parameters here')
      >[/color]

      then:

      window["page" + id] = window.open(URL , id,
      "scrollbars=1,r esizable=1,widt h=520,height=50 0,left=245,top= 262");

      Another note: top value will not be honored, will have to be adjusted
      because top + height are greater than the availHeight of most users'
      screen res. (800x600 and 1024x768): there is now a correction mechanism
      in Mozilla and MSIE 6 SP2 implemented to make sure that secondary
      windows are NOT offscreen, are always within the available work area for
      applications.
      The fact that now MSIE 6 SP2 allows users to force presence of statusbar
      also makes coding top and height values more restrictive, constraining.

      DU
      --
      The site said to use Internet Explorer 5 or better... so I switched to
      Mozilla 1.7.3 :)

      Comment

      Working...