Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Weird behavior of pop-up window

 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
kiruvembai thalam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your quick reply. I'd try it out & let you know the outcome.
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic