jquery+html5 在web页面播放提示音
2015-12-15 23:02
666 查看
<html> <head> <title> New Document </title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> </head> <script type="text/javascript" src="jquery-1.8.2.min.js"></script> <script type="text/javascript"> function play(){ if($.browser.msie && $.browser.version=='8.0'){ $('#newMessageDIV').html('<embed src="notify.mp3"/>'); }else{ //IE9+,Firefox,Chrome均支持<audio/> $('#newMessageDIV').html('<audio autoplay="autoplay"><source src="notify.mp3"' + 'type="audio/wav"/><source src="notify.mp3" type="audio/mpeg"/></audio>'); } } </script> <body> <div id="newMessageDIV" style="display:none">123132</div> <input type="button" value="dada" onclick="play()"/> </body> </html>
以上代码为自己整理,音频文件和jquery见附件
相关文章推荐
- 20151215jqueryUI--dialog代码备份
- 20151215jquery学习笔记--jqueryUI --dialog(对话框)
- JQuery归纳总结(增加中...)
- JQuery归纳总结(增加中...)
- jquery实现全文检索与鼠标滑过工具栏特效
- [jQueryUI] - Chosen:select下拉选择框美化插件及问题
- jQuery中.live()方法的用法深入解析
- jquery.validate校验+jquery.form提交,配合使用
- 面向对象编写jQuery插件
- jquery学习随笔(简单选择器)
- 网页截图插件(放大插件)
- 锋利的JQuery —— JQuery性能优化
- jQuery扩展与noConflict
- jQuery官网API的简易解读
- jquery validate
- myeclipse中导入的jquery文件报错
- jquery 新闻滚动效果
- 使用JQuery中dataTable展示分页
- [jquery]高级篇--js绑定事件
- jquery跨域请求