Method 1:
Copy codeThe Code is as follows:
Html>
</Head>
<Script type = "text/javascript">
// Initialize the thunder plug-in
Function InitialActiveXObject ()
{
Var Thunder;
Try
{
Thunder = new ActiveXObject ("ThunderAgent. Agent ")
} Catch (e)
{
Try
{
Thunder = new ActiveXObject ("ThunderServer. webThunder.1 ");
} Catch (e)
{
Try
{
Thunder = new ActiveXObject ("ThunderAgent. Agent.1 ");
} Catch (e)
{
Thunder = null;
}
}
}
Return Thunder;
}
// Start download
Function Download (url)
{
Var Thunder = InitialActiveXObject ();
If (Thunder = null)
{
DownloadDefault (url );
Return;
}
Try
{
Thunder. AddTask (url, "", 1, 10 );
Thunder. CommitTasks ();
} Catch (e)
{
Try
{
Thunder. CallAddTask (url, "", "", 1 ,"","");
} Catch (e)
{
DownloadDefault (url );
}
}
}
// Fault Tolerance function, open the default browser to download
Function DownloadDefault (url)
{
// Alert ('Open your browser to download .......');
}
</Script>
</Head>
<Body>
<Input type = "button" value = "Download" onclick = "Download ('thunder: // upload')"/>
</Body>
</Html>
Method 2:
Copy codeThe Code is as follows:
<Html>
<Head>
<SCRIPT src = "http://www.jb51.net/js/thunderhref.js"> </SCRIPT>
</Head>
<Body>
<A oncontextmenu = ThunderNetwork_SetHref (this) class = aThunder onclick = "return OnDownloadClick_Simple (this)" href = "thunder: // configure "thunderResTitle =" thunder download "thunderType =" 04 "thunderPid =" 00008 "thunderHref =" thunder: // downloads "> thunder download </a>
</Body>
</Html>