Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Weird behavior of pop-up window

 
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!
 
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.
 
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic