aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Weird behavior of pop-up window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Weird behavior of pop-up window" Watch "Weird behavior of pop-up window" New topic
Author

Weird behavior of pop-up window

Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
I'm trying to open a new pop-up window when the user click on a hyperlink. The problem is that sometimes more than 1 window is opened when the link is clicked. I'm trying to open a non-resizable window without the address & tool bars. But when the extra window appears, my contents are shown in a normal window while the non-resizable window is blank.

This is how my codes looked like:


Does anyone knows what I'm missing out here or doing wrong?

Thanks!


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
kiruvembai thalam
Greenhorn

Joined: May 05, 2004
Posts: 2
Hi,

I too had this problem.. I got solution from Microsoft and it's working fine.

Here is the General Solution given by the Microsoft to the blank window problem:

Problem seemed like happening because of syncronization between open() function and other functions. Do the following.

1. Include

var win1;

win1 = window.open('', 'eah', 'top='+((screen.height - 600) / 2)+',left='+((screen.width - 800) / 2)+'+,toolbar=no,status=no,resizable=no,width=800,height=600,scrollbars=yes');

win1.focus();
window.setTimeout('eah',200);

Hope this would help you..
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Thanks for your quick reply. I'd try it out & let you know the outcome.
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Not sure it is related, but I had all kinds of problem specifing empty string as URL for window.open(). Some browser treated it as the same url as main page, some as "page can not be displayed". Some would assume that this is http url, so if page accessed using https, it will giv popup "do you want to display not-secure items" (the same happends if you not specify a src in iframe).
I actually ended up using empty.html file - empty file that specially used instead of empty string.
 
wood burning stoves
 
subject: Weird behavior of pop-up window