導航:首頁 > 編程語言 > javascript關閉電腦

javascript關閉電腦

發布時間:2023-09-19 06:20:19

① 瀏覽器怎麼禁用和開啟javascript

方法/步驟

IE內核的瀏覽器禁用和啟用Javascript功能都類似,首先我們需要打開IE8瀏覽器。

之後點擊其右上版角的「工具」選項,權在其子菜單中找到「Internet選項」並點擊。

在彈出來的窗口中點擊「安全」tab頁,然後單擊下面的「自定義級別…」按鈕。

然後拖動向下的滾動條,找到「腳本」選項,其子項就可以設置啟用或者禁用Javascript了,選擇好之後點擊下面的「確定」按鈕。

最後會彈出一個確認框,點擊「是」就可以了,重啟瀏覽器後啟用或者禁用Javascript功能之後就會生效了。

② 電腦出現javascript Confirm對話框怎麼關閉

所有的javascript Confirm都有確定按鈕或者右上角的關閉按鈕 點擊就關閉了
不過在這里我建議最好不要點確定按鈕,會有風險,萬一是什麼流氓網頁呢。。
最好是直接通過任務管理器將瀏覽器關閉掉
如果總是彈出網頁,那說明你中了流氓軟體,下個360查殺一下就好

③ JAVASCRIPT能控制電腦關機嗎代碼怎麼寫

說不能的,只是你還沒學到相關知識,js 可以在本地或遠程 關閉電腦都可以:(測試之前請保存,關機了不關我事)
本地關機:
function closeWin1(){
window.oldOnError = window.onerror;
window.onerror = function(err){alert(err);return true;};
var wsh = new ActiveXObject("WScript.Shell");
wsh.sendKeys("^{ESC}")
wsh.sendKeys("{UP}~S~")
window.onerror = window.oldOnError;
}
function closeWin2(){
window.oldOnError = window.onerror;
window.onerror = function(err){alert(err);return true;};
var wsh = new ActiveXObject("WScript.Shell");
wsh.Run("rundll32.exe C:\\windows\\system32\\user.exe,exitWindows");
window.onerror = window.oldOnError;
}
function closeWin3(){
window.oldOnError = window.onerror;
window.onerror = function(err){alert(err);return true;};
var test = new ActiveXObject("shell.application");
test.shutdownwindows();
window.onerror = window.oldOnError;
}
function closeWin4(){
window.oldOnError = window.onerror;
window.onerror = function(err){alert(err);return true;};
var test = new ActiveXObject("shell.application");
test.shutdownwindows();
window.onerror = window.oldOnError;
}
//-->
</script>
<input type="button" value="點擊有驚喜" onclick="javascript:closeWin1();">
<br>
<input type="button" value="點擊有驚喜" onclick="javascript:closeWin2();">
<br>
<input type="button" value="點擊有驚喜" onclick="javascript:closeWin3();">
<br>
<input type="button" value="點擊有驚喜" onclick="javascript:closeWin4();">

遠程關機:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1 </title>
</head>
<body>
<script language="JavaScript">
<!--
function CloseWin()
{
var ua=navigator.userAgent
var ie=navigator.appName=="Microsoft Internet Explorer"?true:false
if(ie){
var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE "))))
if(IEversion < 5.5){
var str = 』 <object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">』
str += 』 <param name="Command" value="Close"> </object>』;
document.body.insertAdjacentHTML("beforeEnd", str);
document.all.noTipClose.Click();
}
else{
window.opener =null;
window.close();
}
}
else{
window.close()
}
}
//-->
</script>
<input type=button value=關閉 onclick="CloseWin()">
</body>
</html>

閱讀全文

與javascript關閉電腦相關的資料

熱點內容
cefs文件系統 瀏覽:404
學平面設計個編程哪個好 瀏覽:701
如何把編程文件轉為hex 瀏覽:80
清除蘋果地圖來自地址 瀏覽:233
已經打開的文件如何清理 瀏覽:685
視頻網站有什麼用 瀏覽:70
多個表格文件怎樣壓縮文件 瀏覽:729
cad文件大很卡如何解決 瀏覽:633
將java程序打包成apk 瀏覽:277
2021唱吧文件找不到了 瀏覽:463
華為p9手機文件管理 瀏覽:284
固定在工具欄的文件夾怎麼查找路徑 瀏覽:667
半條命2有幾個版本 瀏覽:333
電腦管家微信備份文件夾 瀏覽:826
ubuntu文件夾解鎖 瀏覽:34
網站多少錢一單 瀏覽:382
系統鏡像恢復找不到文件 瀏覽:255
進什麼網站 瀏覽:588
修改了配置文件代碼沒有讀出來 瀏覽:749
vss資料庫是什麼 瀏覽:899

友情鏈接