<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "/DTD/xhtml-mobile10.dtd"> <html xmlns="/1999/xhtml"><head><title>JS播放声音 兼容所有浏览器</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="author" content="龚清林 - " /><script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script></head><body><script language="javascript">playSound();function playSound(){var borswer = window.navigator.userAgent.toLowerCase();if ( borswer.indexOf( "ie" ) >= 0 ){//IE内核浏览器var strEmbed = '<embed name="embedPlay" src="/accessory/ding.wav" autostart="true" hidden="true" loop="false"></embed>';if ( $( "body" ).find( "embed" ).length <= 0 )$( "body" ).append( strEmbed );var embed = document.embedPlay;//浏览器不支持 audion,则使用 embed 播放embed.volume = 100;//embed.play();这个不需要} else{//非IE内核浏览器var strAudio = "<audio id='audioPlay' src='/accessory/ding.wav' hidden='true'>";if ( $( "body" ).find( "audio" ).length <= 0 )$( "body" ).append( strAudio );var audio = document.getElementById( "audioPlay" );//浏览器支持 audionaudio.play();}}</script></body></html>
/10/13通知:
域名已过期,没再续费。要声音文件可以去百度云盘下载,下载地址:/s/1hsw6xJQ 声音文件提示:“您有新的消息,请注意查收!”
/11/1通告:
兼容所有浏览器(吹的,还是有兼容问题)