基本上,這個腳本檢查用戶是否正在運行某個插件,如果是,它會顯示警報......問題在於它顯示警報之後Firefox的旋轉輪一直在旋轉,就像它在等待某個東西。如果我刷新頁面腳本不工作...Firefox javascript,停止腳本
這是代碼:
<script language="javascript">
var isInstalled = false;
function run_if_true() {
isInstalled = true;
document.write("Your addon is installed\n<br>");alert("a");
}
function check_installed() {
if (isInstalled==false) {
document.write("Not installed"); // You can instead have an alert here
} else {
document.write("is installed");
}
}
</script>
</head>
<body onload="javascript:check_installed()">
testing!
<img src="chrome://fil/content/sd.gif"
width="0"
height="0"
onload="javascript: run_if_true()"
style="visibility:hidden">
</body>
</html>
可能重複[你如何停止瀏覽器'沙漏'時,Javascript是完成(停止throbber) ?](http://stackoverflow.com/questions/6067976/how-do-you-stop-browser-from-hourglassing-when-javascript-is-done-stop-throbbe) – 2011-05-31 03:45:02