View Full Version : Updating IFrame OnClick borked on older browsers?

Apr 11th, 2007, 01:01 PM
I'm trying to make a little piece of code that would stop and play a shoutcast stream with just 2 buttons. Most people report it works fine but some with older browsers (IE 6.0) say that when they click on play, it shows the WMP controls but they aren't supposed to show since its loaded in a 0x0 iframe. Could someone help me with this? Thanks.

The code is live at http://wdservers.com/stream/index.php

<script type="text/javascript">
function loadIframe(iframeName, url) {
if ( window.frames[iframeName] ) {
window.frames[iframeName].location = url;
return false;
else return true;

<a href="./stream/stream.php" onclick="document.play.src='./stream/load.jpg';return loadIframe('stream', this.href)"><img id="play" src="./stream/play.jpg" alt="PLAY"></a>
<a href="about:blank" onclick="document.play.src='./stream/play.jpg';return loadIframe('stream', this.href)"><img id="stop" src="./stream/stop.jpg" alt="STOP"></a>

<iframe id="stream" name="stream" src="about:blank" scrolling="no" width="0" height="0" frameborder="0"></iframe>


Apr 11th, 2007, 01:24 PM

Apparently it works fine in firefox but not in IE. What did I do wrong?


Apr 11th, 2007, 04:33 PM
I was up all night trying to figure this out. Anyone have a clue where I messed it up? I think it has to do with the replacing of images onclick.