1. 程式人生 > >用js實現終止瀏覽器對頁面HTML的繼續解析即停止解析 相容firefox

用js實現終止瀏覽器對頁面HTML的繼續解析即停止解析 相容firefox

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>測試一下</title>
</head>
<body>
<script language="javascript">
function mystop(){
if(!!(window.attachEvent && !window.opera))
{document.execCommand("stop");}
else
{window.stop();}
}
mystop();
</script>
就是不出來。
</body>
</html>