Forum Moderators: open

Message Too Old, No Replies

JS Popup problem

Problem with the titlebar of the JavaScript popup window

         

LoPoBo

9:57 pm on Oct 29, 2006 (gmt 0)

10+ Year Member



I have a problem with the window.open() function.
The title of the popup window is "http://rooturl - Title" instead of "Title".
Is it possible to fix this?

JAB Creations

5:30 pm on Oct 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi LoPoBo,

Please post a test case of your code here for us to help you out.

I personally use

put your HTML/CSS/JavaScript here
to contrast my English and syntax.

- John

[edited by: tedster at 6:08 pm (utc) on Oct. 30, 2006]
[edit reason] fix formatting [/edit]

Leosghost

5:52 pm on Oct 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hey John ..you seem to have broken the board ;-)

penders

8:41 am on Oct 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The title of the popup window is "http://rooturl - Title" instead of "Title".

What browser are you using?

RonPK

1:18 pm on Oct 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Firefox does this. It's probably some sort of anti-phishing behavior. I doubt there is a workaround.

LoPoBo

7:16 pm on Oct 31, 2006 (gmt 0)

10+ Year Member



Please post a test case of your code here for us to help you out.

This is my code:

remote = window.open(newwinurl, "blankwindow", "toolbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,width=600,height=400,screenX=50,screenY=50");

I tryed adding this, but it didn't work:
remote.title = "Title";

LoPoBo

7:18 pm on Oct 31, 2006 (gmt 0)

10+ Year Member



What browser are you using?

IE 6.0

penders

12:54 am on Nov 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The title of the popup window is "http://rooturl - Title" instead of "Title".
...IE6

IE6 does not seem to exhibit this behaviour (as far as I can see). But, as RonPK states, Firefox does.

However... FF shows only the 'Title' if you pass only the filename to the window.open() function:
>>>

remote = window.open('myfile.html');

Ok, you have no immediate control over how it looks (menu, toolbar etc.), but you have a new window with the correct Title and no URL. You can then call remote.resizeTo() / moveTo() to size the window as you wish.

I tryed adding this, but it didn't work:
>>> remote.title = "Title";

You need to set: (but you can't get rid of the URL if it shows)

remote.document.title

But there seems to be a timing issue with FF, for example:

remote = window.open('myfile.html'); 
alert(remote.document.title);
alert(remote.document.title);

The first alert() is empty, the second alert() has the correct title text! And likewise, you cannot set the title immediately (but ok after the alert!)?!

LoPoBo

6:43 pm on Nov 2, 2006 (gmt 0)

10+ Year Member



Thanks for the help!
My new code is:
remote = window.open(newwinurl);
remote.resizeTo(600, 400);
remote.moveTo(50, 50);

I havn't checked how it looks in Firefox, but it works in IE.

adb64

8:55 pm on Nov 2, 2006 (gmt 0)

10+ Year Member



About the window title, I also had the same problem and I couldn't get a solution for it.
Also see these 2 threads about the same issue: [webmasterworld.com...] and [webmasterworld.com...]

About the delay issue mentioned by penders, I also experienced this. See the the first of the above mentioned threads. When I used a setTimeout() to update the title I was able to do so, but it is always preceded by the URL.