当您尝试打开一个XML文档的时候,XML解析器可能会发现文档中存在某些错误,通过访问parseError对象,将返回一些值,如error code,error text,error line等
Example
使用如下代码,load非现成的xml文档或者load一个现成的存在xml语法错误的xml文档,按照 实际情况将会有不同的结果.
|
<script language="JavaScript" type="text/JavaScript"> document.write("<br>Error Code: ") |
The parseError Properties
| Property | Description |
| errorCode | Returns a long integer error code |
| reason | Returns a string explaining the reason for the error |
| line | Returns a long integer representing the line number for the error |
| linePos | Returns a long integer representing the line position for the error |
| srcText | Returns a string containing the line that caused the error |
| url | Returns the url pointing the loaded document |
| filePos | Returns a long integer file position of the error |
博客介绍了尝试打开XML文档时,XML解析器可能发现文档错误。通过访问parseError对象可返回error code、error text等值。还给出示例,说明load非现成或有语法错误的XML文档会有不同结果。
1462

被折叠的 条评论
为什么被折叠?



