J
justsee
Hi,
I've written a simple function to launch a popup window to display
images. It works across all browsers, except in Safari the <title> is
not displayed, and if I attempt to view source of the popup window
there is no source, and I cannot save the page?:
<script type="text/javascript">
function p(i)
{
w = 530;
h = 403;
x4 = screen.width/2 - (w/2);
y4 = screen.height/2 - (h/2);
if (document.all)
{
w=530;
h=380;
}
var winattribs='width='+w+',height='+h+',scrollbars=no,
resizable=yes,left='+x4+',top='+y4 ;
var page = '<html><head><title>Title here</title></head><body
style="padding:0px;margin:0px;"><img
src="images/launch/pics/'+i+'.jpg"></body></html>';
popwin=window.open("","t",winattribs)
popwin.resizeTo(w, h)
popwin.document.open()
popwin.document.write(page)
popwin.document.close()
popwin.focus()
}
</script>
I've searched for quite awhile looking for some particular Safari bug
to do with document.write and am coming up empty handed. The outputted
html from this function should work correctly in Safari so I am
assuming it has to do with opening and writing to the document which
Safari does not like.
Any help greatly appreciated.
I've written a simple function to launch a popup window to display
images. It works across all browsers, except in Safari the <title> is
not displayed, and if I attempt to view source of the popup window
there is no source, and I cannot save the page?:
<script type="text/javascript">
function p(i)
{
w = 530;
h = 403;
x4 = screen.width/2 - (w/2);
y4 = screen.height/2 - (h/2);
if (document.all)
{
w=530;
h=380;
}
var winattribs='width='+w+',height='+h+',scrollbars=no,
resizable=yes,left='+x4+',top='+y4 ;
var page = '<html><head><title>Title here</title></head><body
style="padding:0px;margin:0px;"><img
src="images/launch/pics/'+i+'.jpg"></body></html>';
popwin=window.open("","t",winattribs)
popwin.resizeTo(w, h)
popwin.document.open()
popwin.document.write(page)
popwin.document.close()
popwin.focus()
}
</script>
I've searched for quite awhile looking for some particular Safari bug
to do with document.write and am coming up empty handed. The outputted
html from this function should work correctly in Safari so I am
assuming it has to do with opening and writing to the document which
Safari does not like.
Any help greatly appreciated.