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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load bar sticks when using function

Status
Not open for further replies.

JamesManke

Programmer
Jul 1, 2004
54
CA
When I use this script in Firefox, the load bar sticks at half way, although the image completely loads. Works fine in IE, just

function larger(n,p,w,h)
{
var win = window.open("","","width=" + w + " , height=" + h + " , top=100 , left=100 , scrollbars=no, resizable=no")
win.document.writeln("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' ' <html xmlns=' xml:lang='en-CA' lang='en-CA'> \n <head> \n <title>" + n + "</title> \n</head>");
win.document.writeln("<body style='margin:0px;padding:0px;'><img style='margin:0px' src='cat_images/" + p + "' width='" + w + "' height='" + h + "'></body></html>")
}
 
Add the final line:

win.close();

to your function and see what happens.

Lee
 

I think Lee means "win.document.close();". You should also put "win.document.open()" before doing the document.write().

Hope this helps,
Dan

 

Incidentally, you can remove the following two items from your window parameters:

Code:
scrollbars=no, resizable=no

as they will be off by default, AFAIK.

Hope this helps,
Dan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top