<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Play mp3 Song on page Load</title>
</head>
<body onload="playSound('horse.mp3')">
<span id="dummy"></span>
</body>
<script language="javascript" type="text/javascript">
<!--
function playSound(soundfile) {
document.getElementById("dummy").innerHTML="<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
}
-->
</script>
</html>
<!------------------------------------------------------------------------------------->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Play mp3 Song on page Load</title>
</head>
<Script>
function getMimeType(){
var mimeType = "application/x-mplayer2"; //default
var agt=navigator.userAgent.toLowerCase();
if (navigator.mimeTypes && agt.indexOf("windows")==-1) {
//non-IE, no-Windows
var plugin=navigator.mimeTypes["audio/mpeg"].enabledPlugin;
if (plugin) mimeType="audio/mpeg" //Mac/Safari & Linux/FFox
}//end no-Windows
return mimeType
}//end function getMimeType
var imagePath = 'DenaJingle.mp3';
function playSound(){
alert("hi");
document.getElementById("songplay").innerHTML="<embed src=\""+imagePath+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" type='"+getMimeType()+"' />";
}
</script>
<body onload="playSound()">
<span id="songplay"></span>
</body>
</html>
<!------------------------------------------------------------------------------------->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Play mp3 Song on page Load</title>
</head>
<Script>
function getMimeType(){
var mimeType = "application/x-mplayer2"; //default
var agt=navigator.userAgent.toLowerCase();
if (navigator.mimeTypes && agt.indexOf("windows")==-1) {
//non-IE, no-Windows
var plugin=navigator.mimeTypes["audio/mpeg"].enabledPlugin;
if (plugin) mimeType="audio/mpeg" //Mac/Safari & Linux/FFox
}//end no-Windows
return mimeType
}//end function getMimeType
var imagePath = 'DenaJingle.mp3';
function playSound(){
alert("hi");
document.getElementById("songplay").innerHTML="<embed src=\""+imagePath+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" type='"+getMimeType()+"' />";
}
</script>
<body onload="playSound()">
<span id="songplay"></span>
</body>
</html>