html代码:
button是bootstrap样式,请先加入bootstrap.min.css和jquery-1.11.1.min.js
1 <a href="#" id="DownLoadAudio" target="_blank"></a> 2 <button id="Submit6" class="btn btn-sm btn-success" type="button" onclick="openWin(@item.UserID,@item.AudioID)"> 3 <i class="glyphicon glyphicon-download-alt"></i>下载</button>
javascript代码:
1 <script type="text/javascript"> 2 function openWin(userid, audioid) { 3 var obj = document.getElementById("DownLoadAudio"); 4 obj.href = data.state; 5 obj.click(); 6 }7</script>
时间: 2024-11-05 11:39:50