troubleshooting Question

Loading a link in parent on Safari

Avatar of Dada44
Dada44Flag for Spain asked on
JavaScriptWeb Browsers
5 Comments1 Solution439 ViewsLast Modified:
Dear all,

I have the following pop up code in my main page:

<script language="javascript">
 
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
 
        LeftPosition = parseInt( (screen.width) ? (screen.width-w)/2 : 0);
        TopPosition = parseInt( (screen.height) ? (screen.height-h)/2 : 0);
        settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=yes';
        win = window.open(mypage,myname,settings)      
}
</script>

  </head>
  <body>


  </body>

<a href="mypopup.htm" onclick="NewWindow(this.href,'theWindow','416','337','no');return false">OPEN IT!</a>

It is working great and cross browser

In mypopup.htm I have:

    <script language="javascript">
 function loadinparent(url){
  self.opener.location = url;
   self.close();
    }
</script>

  </head>
  <body>
<a href="javascript:loadinparent('anotherpage.htm', false);" >go  to another page</a>

And this loads anotherpage.htm in the main page where the OPEN IT! link is. This is the way it has to be, and works everywhere except for Safari. On Safari the contents of mypopup.htm show in the main page and there's no new window for the pop up, there's no pop up at all.
Can anyone please give me a hand to make it work on Safari???

Thanks a lot!!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros