用js播放.wav文件 复制代码 代码如下: <BR>function playSound(id) <BR>{ <BR>var node=document.getElementById(id); <BR>if(node!=null) <BR>{ <BR>node.Play(); <BR>} <BR>} <BR> music.wav/> var recordhisStore = new Ext.data.JsonStore({ root: 'dataRoot', totalProperty: 'totalCount', idProperty: 'threadid', remoteSort: true, fields: [ {name: 'id', type: 'string'}, {name: 'src', type: 'string'}, {name: 'dst', type: 'string'}, {name: 'srcip', type: 'string'}, {name: 'dstip', type: 'string'}, {name: 'begin_date', type: 'date', dateFormat:'Y-m-d H:i:s'},//onclick='javascript:startwav(\" "+ value +" \")' {name: 'end_date', type: 'date', dateFormat:'Y-m-d H:i:s'}, {name: 'content', type: 'string', convert:function(value,rec){ return ""+value+""; }} ], proxy: new Ext.data.HttpProxy({ url: 'ctl.php?c=HisRecordQueryController&a=Query' }), sortInfo: {field: 'begin_date', direction: 'ASC'}, listeners:{ beforeload:function(obj,params){ var begin_date = document.getElementById("his_startdt").value; var end_date = document.getElementById("his_enddt").value; var src = document.getElementById("his_src").value; var dst = document.getElementById("his_dst").value; recordhisStore.baseParams = {limit:params.params.limit,start:params.params.start,begindate:begin_date,enddate:end_date,src:src,dst:dst}; } } }); js播放wav文件 复制代码 代码如下: 使用js,每隔1s播放对应的wav文件 <BR>var arr = new Array(); <BR>var c = 0; <BR>window.onload = function () { <BR>var value1 = '<%=tel_2 %>'; <BR>var value2 = '<%=je %>' <BR>StrToArray(value1); <BR>StrToArray(value2); <BR>} <BR>var StrToArray = function (str) { <BR>for (var i = 0; i < str.length; i++) { <BR>arr[arr.length] = str.charAt(i); <BR>} <BR>} <BR>var id = window.setInterval(function () { <BR>if (c > arr.length) { <BR>window.clearInterval(id); //清除 <BR>return; <BR>} <BR>embed(arr[c++]); <BR>}, 1000); <BR>var embed = function (num) { <BR>if (num == "" || typeof num == "undefined") return; <BR>document.getElementById("embed").innerHTML = "<embed name=\"player\" TYPE=\"application/x-mplayer2\" src=\"../wav/" + num + ".wav\" loop=\"false\" autostart=\"true\" hidden=\"true\">"; <BR>} <BR>