方法一: 复制代码 代码如下: html><br><br>//初始化迅雷插件<br><br>function InitialActiveXObject()<br><br>{ <br><br> var Thunder;<br><br> try<br><br> {<br><br> Thunder = new ActiveXObject("ThunderAgent.Agent") <br><br> }catch(e)<br><br> {<br><br> try<br><br> {<br><br> Thunder=new ActiveXObject("ThunderServer.webThunder.1");<br><br> }catch(e)<br><br> {<br><br> try<br><br> {<br><br> Thunder = new ActiveXObject("ThunderAgent.Agent.1");<br><br> }catch(e)<br><br> {<br><br> Thunder = null;<br><br> } <br><br> } <br><br> }<br><br> return Thunder;<br><br>}<br><br>//开始下载<br><br>function Download(url)<br><br>{<br><br> var Thunder = InitialActiveXObject();<br><br> <br><br> if(Thunder == null)<br><br> {<br><br> DownloadDefault(url);<br><br> return;<br><br> } <br><br> try<br><br> { <br><br> Thunder.AddTask(url,"","","","",1,1,10);<br><br> Thunder.CommitTasks(); <br><br> }catch(e)<br><br> {<br><br> try<br><br> {<br><br> Thunder.CallAddTask(url,"","",1,"",""); <br><br> }catch(e)<br><br> {<br><br> DownloadDefault(url);<br><br> } <br><br> }<br><br>}<br><br>//容错函数,打开默认浏览器下载<br><br>function DownloadDefault(url)<br><br>{<br><br> //alert('打开浏览器下载.......');<br><br>}<BR>