Dada44
asked on
Simple javascript not working in Safari
Dear all,
The following javascript works great in all browsers but Safari.
It opens a centered pop up when the link is clicked, but in Safari I get a full window.
How can it be fixed for it to work in Safari??
Thanks very much in advance!!
The following javascript works great in all browsers but Safari.
It opens a centered pop up when the link is clicked, but in Safari I get a full window.
How can it be fixed for it to work in Safari??
Thanks very much in advance!!
<html>
<head>
<script language="javascript">
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
</script>
</head>
<body>
<a href="mypage.htm" onclick="NewWindow(this.href,'name','431','341','no');return false" >Open pop up</a>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER