hopefulcd
March 10th, 2009, 01:48 PM
Hi all, I'm having a problem with cross-browser compatibility and javascript. There are two main problems that I can't seem to get past.
1. Basically, I have a page that dynamically loads a new iframe when the user doubleclicks on an option from a select box. This is done by changing the src attribute of the iframe. This works fine on FF and Opera, but IE7 and Safari both don't work. I'll paste the code that I'm using below.
2. The second issue is similar to the first, but instead of an iframe it's a link (<a href=""...). The link's src (href) is supposed to change when the user (single) clicks on an option from the select list. Again, the code works fine on FF and Opera, but IE7 and Safari both don't work.
Any help or solutions to these problems would be greatly appreciated. Thanks.
Here's the code:
<html>
<head>
<script type="text/javascript">
function reload(selected)
{
var url = "http://woodmarchurch.org/a/" + selected;
parent.audplay.location = url;
}
function linkchange(text)
{
var url = "http://woodmarchurch.org/audio/";
var aud = text;
document.getElementById('auddown').href = (url + aud);
}
</script>
</head>
<body>
<select size="15" name="audlist" id="audlist" style="width:100%; min-width:320px; overflow:auto">
<option ondblclick="reload('aud35')" onclick="linkchange('some1.mp3')" value="aud35">Audio 1
<option ondblclick="reload('aud1')" onclick="linkchange('some2.mp3')" value="aud1">Audio 2
<option ondblclick="reload('aud54')" onclick="linkchange('some3.mp3')" value="aud54">Audio 3
<option ondblclick="reload('aud90')" onclick="linkchange('some4.mp3')" value="aud90">Audio 4
</select>
<a name="auddown" style="color:#990000" id="auddown" href=""><u>Download</u></a>
<iframe id="audplay" name="audplay" style="height:260px; width:340px; border:3px #CC0000 groove" src="http://somesite.org/a/aud87/index.html"></iframe>
</body>
</html>
1. Basically, I have a page that dynamically loads a new iframe when the user doubleclicks on an option from a select box. This is done by changing the src attribute of the iframe. This works fine on FF and Opera, but IE7 and Safari both don't work. I'll paste the code that I'm using below.
2. The second issue is similar to the first, but instead of an iframe it's a link (<a href=""...). The link's src (href) is supposed to change when the user (single) clicks on an option from the select list. Again, the code works fine on FF and Opera, but IE7 and Safari both don't work.
Any help or solutions to these problems would be greatly appreciated. Thanks.
Here's the code:
<html>
<head>
<script type="text/javascript">
function reload(selected)
{
var url = "http://woodmarchurch.org/a/" + selected;
parent.audplay.location = url;
}
function linkchange(text)
{
var url = "http://woodmarchurch.org/audio/";
var aud = text;
document.getElementById('auddown').href = (url + aud);
}
</script>
</head>
<body>
<select size="15" name="audlist" id="audlist" style="width:100%; min-width:320px; overflow:auto">
<option ondblclick="reload('aud35')" onclick="linkchange('some1.mp3')" value="aud35">Audio 1
<option ondblclick="reload('aud1')" onclick="linkchange('some2.mp3')" value="aud1">Audio 2
<option ondblclick="reload('aud54')" onclick="linkchange('some3.mp3')" value="aud54">Audio 3
<option ondblclick="reload('aud90')" onclick="linkchange('some4.mp3')" value="aud90">Audio 4
</select>
<a name="auddown" style="color:#990000" id="auddown" href=""><u>Download</u></a>
<iframe id="audplay" name="audplay" style="height:260px; width:340px; border:3px #CC0000 groove" src="http://somesite.org/a/aud87/index.html"></iframe>
</body>
</html>