...

View Full Version : window.open(...) WORKS: FireFox, DOESN'T WORK: IE



tomjoyce
02-01-2005, 01:14 AM
<script language="JavaScript1.2">
function oC(x)
{
sw = screen.width;
sh = screen.height;
nsw = sw/1.25;
nsh = sh/1.25;
window.open('detail.php?type=2&x='+x,'Detailed View','width='+nsw,'height='+nsh,'resizable=0,scrollbars=1,toolbar=0,location=0,directories=0,status =1,menubar=0,copyhistory=0');
}
</script>


I have a table with images and I need to be able to click on an image and have it pop up with details in a new window. It works in FireFox and it doesn't in Internet Explorer. Since most visiters to this site use Internet Explorer, this bug is completely inexcusable. I need to fix it ASAP, as the time constraint is soon approaching. If it stops working in FireFox to solve the IE problem, I can handle that and it isn't a problem to my boss.
Please help as soon as you can, since I'm more of a database backend/server side scripting guy, not a client side scripting/design/etc. guy...

Thanks,
Tom Joyce

tomjoyce
02-01-2005, 01:47 AM
Solution Found:
http://forums.devshed.com/showpost.php?p=966504&postcount=2

Thanks for reading!

_Aerospace_Eng_
02-01-2005, 01:52 AM
<script type="text/javascript">
function oC(x)
{
nsw = (screen.width)/1.25;
nsh = (screen.height)/1.25;
myLeft = (screen.width-nsw)/2;
myTop = (screen.height-nsh)/2;
window.open('detail.php?type=2&x='+x+'','DetailedView','width='+nsw+',height='+nsh+',left='+myLeft+',top='+myTop+',resizable=0,scro llbars=1,toolbar=0,location=0,directories=0,status=1,menubar=0,copyhistory=0');
}
</script>
this should be cross browser functional it worked in IE,FF, and Netscape, and it centers the newly opened window centered on the screen, but if u found a solution feel free to use that one also



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum