JS 添加网页桌面快捷方式的代码
生活随笔
收集整理的這篇文章主要介紹了
JS 添加网页桌面快捷方式的代码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<script>
function toDesktop(sUrl, sName) {
try {var WshShell = new ActiveXObject(“WScript.Shell”);var oUrlLink = WshShell.CreateShortcut(WshShell.SpecialFolders(“Desktop”) + “\\” + sName + “.url”);oUrlLink.TargetPath = sUrl;oUrlLink.Save();
} catch (e) {alert(“當前IE安全級別不允許操作!”);}
}
</script>
</head>
<body><a href=”javascript:void(0);” onclick=”toDesktop(‘http://zl.aisky.net/’,’小龍驛站’)”>創建快捷方式</a>
</body>
總結
以上是生活随笔為你收集整理的JS 添加网页桌面快捷方式的代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 解决nginx负载均衡的session共
- 下一篇: intellij idea 常见遇到的问