Skip to main content
gamedev.net
🔒 Locked

[web] Javascript Popup Window

Started by swordfish Oct 3, 2007 at 6:28 PM 0 replies 1.2k views
Original Post
swordfish
swordfish
I have a basic popup window with &#106avascript:

function CouponPopup(url, title, info1, info2, width, height)
{
	try
	{
		var winWidth = parseInt(width)+17;
		var winHeight = parseInt(height)+65;
		var popupWin = window.open('about:blank','coupon','scrollbars=yes,menubar=no,height='+winHeight+',width='+winWidth+',resizable=yes,toolbar=no,location=no,status=no');
		popupWin.document.write('<html><head><title>Coupon</title></head><body>');
		popupWin.document.write('<img src="'+url+'">
'); popupWin.document.write(title+'
'); popupWin.document.write(info1+'
'); popupWin.document.write(info2+'
'); popupWin.document.write('</body></html>'); return; } catch(ex) { alert(ex); } }
Everything works fine, but something is driving me crazy. In Firefox, after this popup window opens, the status bar just "hangs" as if it's loading something, even though it's not. Does anybody know how to get this status bar to go away? Thanks.
http://blog.protonovus.com/
Ibatex
Ibatex
A simple popupWin.document.close() when you're finished with the output should do the trick. Also document.write is most efficient when you assemble everything you want to write in a variable and document.write it in one swoop.

[Edited by - Ibatex on October 4, 2007 12:49:15 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.