This code works perfect for crome and firefox.. but error in IE8
if($('#soundcheck').is(':checked')){
//alert('checked');
var audio = document.createElement('audio');
document.body.appendChild(audio);
audio.src = system_base_url+'/sound/horn.wav';
audio.play();
}
IE8 says: Object doesn't support this property or method, and it points to :
audio.play();
Anyone having similar experience with IE8?
Regards
The <audio>
tag is HTML5 and is only supported in newer browsers, such as Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
IE 8 and earlier does not support Audio tag, you need to use some hack. Hope it can help.
<audio id='audio' controls>
<source src="audioes/song.ogg" type="audio/ogg" />
<source src="audioes/song.mp3" type="audio/mp3" />
<div>Your browser doesn't support HTML5 audio</div>
<%--Fall back on the WMP plugin--%>
<object id='mediaPlayer' type="audio/mpeg" width="200" height="40"><param name="src" value="audioes/song.mp3" /></object>
</audio>
<script type="text/javascript">
function play () {
var audio = document.getElementByID('audio');
var mediaPlayer = document.getElementByID('mediaPlayer');
//HTML5 Audio is Supported
if(audio['play'])
{
audio.play();
}
//HTML5 Audio is NOT Supported
else
{
mediaPlayer.object.play();
}
}
</script>
Possible Duplicate: Javascript outer scope variable access I have a javascript module that looks something like below. The main issue I'm having is how to access variables in the "this" scope ...
Possible Duplicate: Javascript outer scope variable access I have a javascript module that looks something like below. The main issue I'm having is how to access variables in the "this" scope ...
i can find text of an element by using this code.but i want to find a single word any where in my page if mouse hovers on that word for certain time. $(document).bind("mouseover", function (e) { ...
i can find text of an element by using this code.but i want to find a single word any where in my page if mouse hovers on that word for certain time. $(document).bind("mouseover", function (e) { ...
I've attached an autocomplete function to a text input field in an html form. I can handle when the user selects something in the suggest box and it all works fine. I use "suggest" as source. My ...
I've attached an autocomplete function to a text input field in an html form. I can handle when the user selects something in the suggest box and it all works fine. I use "suggest" as source. My ...
Jquery Ajax call only fires once after that if i click on the button it does return the last returned reponse but doesn't go the ajax function in c# Here is my aspx code <asp:ImageButton ID="...
Jquery Ajax call only fires once after that if i click on the button it does return the last returned reponse but doesn't go the ajax function in c# Here is my aspx code <asp:ImageButton ID="...