Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript window.open() hangs second time around...

Status
Not open for further replies.

dBjason

Programmer
Mar 25, 2005
355
US
I'm opening a child aspx page that is opened from a parent page using javascript (listed below). It works GREAT the first time -- but hangs on the second and any concurrent attempts, sometimes resulting in a timeout error. Here's the code from the parent page:

function ShowPanel(url)
{
var width = 750;
var height = 575;
var left = (screen.width - width) / 2;
var top = (screen.height - height) / 2;
var params = 'width=' + width + ', height=' + height;
params += ', top=' + top + ', left=' + left;
params += ', toolbar=no';
params += ', menubar=no';
params += ', resizable=yes';
params += ', directories=no';
params += ', scrollbars=no';
params += ', status=no';
params += ', location=no';
newwin = window.open(url, 'd', params); //<--- Change This (LetterNumber) When Copying!
if (window.focus)
{
newwin.focus();
}
return false;
}



The child page is closed via another javascript function, as follows:

function CloseMe()
{
window.opener = top;
window.close();
return false;
}



Am I missing something here?

Thanks, Jason
 
Hi

Does it happen in all browsers or only in some of them ? I tried the code you posted in FireFox and experienced no problem.

In those two functions there is nothing that should make the browser to hang. ( The only bad thing is [tt]window.opener = top;[/tt] - after it was grossly abused, the [tt]opener[/tt] property is read-only in modern browsers. But for backward compatibility neither that does anything ugly. ) Is there more JavaScript code in your files ?


Feherke.
 

Okay, tried it in Chrome and guess what -- works great.

BUT: It's an intranet application. The whole company is on IE8 and won't switch no matter whose rear I kiss / bribe / blackmail / bury in the woods.

Sooo... What can I do? Or should I begin revamping my resume/CV?

Thanks,
Jason
 
Hi

Sorry, then I can not help further with this.
Jason said:
Or should I begin revamping my resume/CV?
Depends on whether your autobiography mentions versatility in using lightboxes. ;-) Those used to be more portable and predictable than popup windows. I would try using for example GreyBox to open that link in a lightbox instead of popup.


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top