[thelist] bug in javascript on mac IE5 [repost]

John Pye john.pye at purplehouse.com
Fri Mar 9 05:30:07 CST 2001


Hello all

[I've posted this again because I think I've been having a problem with my
email. Apologies if this already went through]

I've been having a nagging javascript problem on Mac IE 5.0 which I don't
get on PC IE5.5 or PC Netscape 4.08. Would most appreciate any suggestions.

I have a form with two buttons as part of an image selection/uploading
application in Javascript/Cold Fusion. One button opens a window of one size
and purpose (select an image on the server), the other button opens another
window of another, different, size and purpose (upload your image).

The code opens and closes windows fine on PC IE and Netscape. But on Mac, it
opens only one window. When you close the first window, or leave it up to
the script to close it, and then try to make the other window open, nothing
appears or happens.

I use the same name and object variable for both of the windows, and I only
allow one or the other window to be open at one time, as:

	if(window.puw&&puw.open&&!puw.closed){
		//alert("closing your other window.");
		puw.close()
	}

The next line then opens the new window, as

	puw=window.open(url,"picgrabber","width="+w+",
		height="+h+",scrollbars="+sb);
	puw.focus();

I already tried the following without success: (dependent is supposed to be
good for auto-closing dependent windows in Netscape; then I also tried
opening windows with a new HTML name each time)

	puw=window.open(url,"picgrabber"+
		(picgrabbercount++),
		"dependent,width="+w+",height="+h+",scrollbars="+sb);
	puw.focus();

In all cases, Mac IE5 closes the other window, then refuses to open a new
window. Javascript still responds and is alive, which I tested with a

	<input type=button value="test" onclick="alert('javascript is ok')">

Hopefully I'm just leaving out something simple that somebody can point out.
I'd be very grateful.

KUTGW


John Pye
http://www.creativebase.com/
+44 (0)20 7258 6900






More information about the thelist mailing list