[thelist] One popup window, different sizes

Robert Carpenter evolt at thebigcrux.com
Wed Oct 12 20:33:27 CDT 2005


> Try this slight modification:
> var popWin = false;
> function popNew(a,n,h,w)    {
>    if(popWin && popWin.close){
>     popWin.close();
>    }
>    popWin = window.open(a,n,'directories=0,height=' + h + ',width=' +
> w + ',location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0');
>    return false;
> }

Thanks, Matt.

That's closer...it closes the existing popup window, and it stopped throwing
the "Value undefined (result of expression popWin.close) is not an object."
error, but it also doesn't open a new popup, at least without a second
click.

Of course, the site is for a mac-based business, so while some relatively
small percentage of their visitors would see this problem, the vast majority
of the principals would...sigh...

Perhaps I'm taking the wrong tack here, though - would it be better to
attempt to resize the existing window and change it's contents, rather than
closing the current popup and reopening a new one? resizeTo() and
outerWidth()/outerHeight() seem to have their own quirks, as well.

-robert-

> 
> On 10/12/05, Robert Carpenter <evolt at thebigcrux.com> wrote:
>> function popNew(a,n,h,w)    {
>> if((typeof(popWin) != "undefined")){
>>     popWin.close();
>>     }
>> popWin = window.open(a,n,'directories=0,height=' + h + ',width=' + w +
>> ',location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0');
>> return false;
>> }
> 




More information about the thelist mailing list