当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 用js实现终止浏览器对页面HTML的继续解析即停止解析 兼容firefox

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 用js实现终止浏览器对页面HTML的继续解析即停止解析 兼容firefox


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 99 ::
收藏到网摘: n/a

js怎么终止浏览器对页面HTML的解析啊?

如题
<html>
<head>
<meta http-equiv="Content-Type" c />
<title>无标题文档</title>
</head>
<script language="javascript" type="text/javascript">
//这里面要怎么写才能让浏览器不再解析和运行后面的表格和所有代码啊
</script>
<body>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
</tr>
</table>
</body>
</html>
复制代码 代码如下:

IE下用document.execCommand("stop")
FF下用window.stop();

点击运行可以看到效果:
[Ctrl+A 全选 提示:你可先修改部分代码,再按运行]

window.attachEvent && !window.opera是用来判断是否IE的!从Prototype里找出来的!
其实我还真不理解。。这是怎么判断的!
就像那个if(window.XMLHttpRequest)一样!
不过没事看看Prototype收获还是不少的!