Popup works in Firefox but not in IE, any help?

  • 1
  • Question
  • Updated 8 years ago
Hi I am trying to build a website for my band. One of the things I want to incorporate is a popup for our music player so people can still navigate the site while listening to our music. I looked up some tutorials online and managed to make one work in firefox, but when I tried it in IE it doesn't work at all.. heres the code..

<!--

<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=500,height=400,scrollbars=yes');
return false;
}
//-->

<!---
<a href="musicplayer.php" onClick="return popup(this, 'Hundredth Monkey Preview')">
<img src="resources/Menu/MusicBlack.gif"
onmouseover="this.src='resources/Menu/MusicRed.gif';"
onmouseout="this.src='resources/Menu/MusicBlack.gif';"
hspace="0" />

--->

If anyone can help id appreciate it.
Photo of Kevin Kuchar

Kevin Kuchar

  • 3 Posts
  • 0 Reply Likes

Posted 8 years ago

  • 1
Photo of jeremy

jeremy, Employee

  • 1349 Posts
  • 90 Reply Likes
Hello Kevin, 

Pop up's can be a tricky thing to implement and some of them are browser specific.

I am sending your request to our code team and they will be able to assist you further.

Please allow them 24-48 hours to respond to your enquiry.

Many thanks for working with us on this.
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
 Hello Kevin,
 

Thanks for your patience. I am not able to locate your working pop-up code using Firefox. Can you please let me know where I can see this in action and then I can try to figure out why it is not working on IE? 

You may want to consider using a different pop-up script. Here's one that may work for you: http://www.dynamicdrive.com/dynamicindex8/popwin.htm. Dynamic Drive also offers other pop-up boxes. Just enter that term into the search box to see the various options.

 
Photo of Kevin

Kevin

  • 475 Posts
  • 29 Reply Likes
Kevin, it seems that apparently for no reason, IE requires the windowname to be set in quotes, so you have to type it in rather that use a attribute to set it. Also, change the href to a rel attribute, and set the href to "#" because it will return true in IE. Here is the code I've fixed up for you:

<!--
<SCRIPT TYPE="text/javascript">
function popup(mylink)
{
var href;
href=mylink;
var popup=window.open(href, 'Hundredth Monkey Preview', 'width=500,height=400,scrollbars=yes');
}

</script>
<a href="#" rel="musicplayer.php" onClick="popup(this.rel">
<img src="resources/Menu/MusicBlack.gif" onmouseover="this.src='resources/Menu/MusicRed.gif';" onmouseout="this.src='resources/Menu/MusicBlack.gif';" hspace="0" />
</a>
-->

Kevin