hiding URL in popup window title and status bars

Discussion in 'Javascript' started by Jon, Aug 20, 2006.

  1. Jon

    Jon Guest

    Hi,

    I am calling the function showpopupWindow(item) to open and write a
    popup window. When testing in IE6 locally the popup window displays my
    text in both the title and status bars but when viewed online from my
    website the titlebar text is preceded by the full URL and a - ( eg
    http://www.........co.uk - text I want to display) and the status bar
    appears to only display Downloading picture
    http://www..........co.uk/..../..../image.jpg... which only changes to
    my text after hovering over 'Buy this item' or 'Contact Us' which
    contain onmouseover and onmouseout code.
    Although it reduces the amount of text I can display, I can live with
    the titlebar if necessary but particularly want to display much more
    useful information in the status bar.

    Thanks

    function showpopupWindow (item) {
    var TitleStatus = 'text I want to display'

    htmlTxt = '<html><head><title>' + TitleStatus + '</title></head>';
    htmlTxt += '<BODY onload="window.titlebar=\'' + TitleStatus + '\';
    return true, window.status=\'' + TitleStatus + '\'; return true"
    leftmargin="5" topmargin="5" scroll="auto">';
    htmlTxt += '<div align="center">';
    .....................
    .....................
    htmlTxt += '<td width=20%><a href="order_form.htm"
    onmouseover="window.status=\'click to buy this item\'; return true",
    onmouseout="window.status=\'' + TitleStatus + '\'; return true">Buy this
    item</a></td><td
    width=20%><a href="mailto:?subject=Mysite Sales - ' +
    menuStr + ' - Item ' + item + '&nbsp;' + cat[item][3] + '&nbsp;' +
    cat[item][4] + '" onmouseover="window.status=\'click to email us\';
    return true", onmouseout="window.status=\'' + TitleStatus + '\'; return
    true">Contact Us</a></td><td><p align="left"><a
    href="javascript:window.close();">Close window</a></td></table></td>';
    htmlTxt += '</tr><tr><td>&nbsp;</td></tr></table></div></body></html>;

    newWindow =
    window.open('','NewWin','width=925,height=600,menubar=no,statusbar=yes,ti
    tlebar=yes,toolbar=no,location=no');
    newWindow.document.write(htmlTxt);
    }

    --
    Jon
    Jon, Aug 20, 2006
    #1
    1. Advertising

  2. Jon

    Randy Webb Guest

    Jon said the following on 8/20/2006 3:56 PM:
    > Hi,
    >
    > I am calling the function showpopupWindow(item) to open and write a
    > popup window.


    Uh oh.

    > When testing in IE6 locally the popup window displays my
    > text in both the title and status bars but when viewed online from my
    > website the titlebar text is preceded by the full URL and a - ( eg
    > http://www.........co.uk - text I want to display) and the status bar
    > appears to only display Downloading picture


    Yes, that's the way it works.

    > http://www..........co.uk/..../..../image.jpg... which only changes to
    > my text after hovering over 'Buy this item' or 'Contact Us' which
    > contain onmouseover and onmouseout code.
    > Although it reduces the amount of text I can display, I can live with
    > the titlebar if necessary but particularly want to display much more
    > useful information in the status bar.


    The status bar is already used for "useful information", you aren't
    trying to improve it, you are attempting to cripple it.

    > onmouseout="window.status=\'' + TitleStatus + '\'; return true">Buy this


    You sure that works? Hint: It doesn't.

    > newWindow =
    > window.open('','NewWin','width=925,height=600,menubar=no,statusbar=yes,ti
    > tlebar=yes,toolbar=no,location=no');


    IE7 defaults to displaying the location bar in a popup no matter what
    you define it as in the window.open call.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Aug 20, 2006
    #2
    1. Advertising

  3. Jon

    Guest

    Randy Webb wrote:
    <snip>
    >
    > The status bar is already used for "useful information", you aren't
    > trying to improve it, you are attempting to cripple it.
    >
    > > onmouseout="window.status=\'' + TitleStatus + '\'; return true">Buy this

    >
    > You sure that works? Hint: It doesn't.


    Oh, it does - depends on your IE 6 patch-status. It was Security-Update
    no Q832894 which fixed this issue:
    http://support.microsoft.com/kb/833786/EN-US/

    Anyway, on my IE it does work fine - but i have to admit, its quite old
    (Win(e)98).. Thus, on a "normal" IE out there, it won't work at all..
    Probably Jon uses some older Version, like mine, thats what confused
    him.


    Ulrich Kautz
    , Aug 20, 2006
    #3
  4. Jon

    Randy Webb Guest

    said the following on 8/20/2006 6:52 PM:
    > Randy Webb wrote:
    > <snip>
    >> The status bar is already used for "useful information", you aren't
    >> trying to improve it, you are attempting to cripple it.
    >>
    >>> onmouseout="window.status=\'' + TitleStatus + '\'; return true">Buy this

    >> You sure that works? Hint: It doesn't.

    >
    > Oh, it does - depends on your IE 6 patch-status.


    Or whether you are using IE 6. I don't, it is IE 7.

    As for it working for me, not in Firefox, not even close.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Aug 20, 2006
    #4
  5. Jon

    Guest

    <snip>
    > >>> onmouseout="window.status=\'' + TitleStatus + '\'; return true">Buy this
    > >> You sure that works? Hint: It doesn't.

    > >
    > > Oh, it does - depends on your IE 6 patch-status.

    >
    > Or whether you are using IE 6. I don't, it is IE 7.


    OK, I thought you were challenging that it does (or rather did) work in
    IE 6.. Never mind.

    >
    > As for it working for me, not in Firefox, not even close.


    Fully agreed.


    Ulrich Kautz
    , Aug 21, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nehmo Sergheyev
    Replies:
    5
    Views:
    452
    Mark Parnell
    Nov 23, 2003
  2. UJ
    Replies:
    1
    Views:
    566
    John Timney \(MVP\)
    Nov 1, 2006
  3. Jens Peter Hansen
    Replies:
    7
    Views:
    512
    Randy Webb
    Jun 19, 2004
  4. Russell
    Replies:
    2
    Views:
    275
    Russell
    Sep 13, 2004
  5. Peter Pippinger

    NB: Hiding Menu-Bars in an already opened Window.

    Peter Pippinger, Nov 19, 2004, in forum: Javascript
    Replies:
    0
    Views:
    82
    Peter Pippinger
    Nov 19, 2004
Loading...

Share This Page