function playSound()
{
var borswer = window.navigator.userAgent.toLowerCase();
if ( !!window.ActiveXObject || "ActiveXObject" in window )
{
//IE内核浏览器
var OSPlayer = new ActiveXObject("WMPLayer.OCX");
OSPlayer.url = "http://www.xmf119.cn/static/admin/sounds/notify.wav";
OSPlayer.controls.play();
} else
{
//非IE内核浏览器
var strAudio = "<audio id='audioPlay' src='http://www.xmf119.cn/static/admin/sounds/notify.wav' hidden='true'>";
if ( $( "body" ).find( "audio" ).length <= 0 )
$( "body" ).append( strAudio );
var audio = document.getElementById( "audioPlay" );

//浏览器支持 audion
audio.play();
}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-11-28
  • 2021-07-27
  • 2022-12-23
猜你喜欢
  • 2021-08-23
  • 2021-08-13
  • 2021-08-23
  • 2022-01-18
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
相关资源
相似解决方案