Web pages play sound automatically

Source: Internet
Author: User

<script type= "Text/javascript" src= "jquery-1.7.2.min.js" ></script><script type= "Text/javascript" >$ (function () {//refer to the following two sites for an introduction//http://www.w3school.com.cn/html/html_audio.asp//http://www.zhanxin.info/ Development/2013-05-17-html5-audio.htmlif ($.browser.msie && $.browser.version== ' 8.0 ') {//originally used here is < Bgsound src= "System.wav"/> the result IE8 not play the sound, so replaced by embed$ (' #newMessageDIV '). html (' <embed src= ' system.wav '/> ');} The else{//ie9+,firefox,chrome supports <audio/>$ (' #newMessageDIV '). html (' <audio autoplay= ' AutoPlay ' >< SOURCE src= "System.wav" ' + ' type= "audio/wav"/><source src= "System.mp3" type= "Audio/mpeg"/></audio> ') ;}}); </script><div id= "Newmessagediv" style= "Display:none" ></div>

Web page plays sound automatically

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.