简单教程
提交运行
代码编辑器:
<html> <meta charset="utf-8"> <link href="/static/next/css/tryit.css?v=2017082407" rel="stylesheet"/> <script> function loadXMLDocErr(dname) { try //Internet Explorer { xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.load(dname); if (xmlDoc.parseError.errorCode != 0) { alert("Error in line " + xmlDoc.parseError.line + " position " + xmlDoc.parseError.linePos + "\nError Code: " + xmlDoc.parseError.errorCode + "\nError Reason: " + xmlDoc.parseError.reason + "Error Line: " + xmlDoc.parseError.srcText); return(null); } } catch(e) { try //Firefox { xmlDoc=document.implementation.createDocument("","",null); xmlDoc.async=false; xmlDoc.load(dname); if (xmlDoc.documentElement.nodeName=="parsererror") { alert(xmlDoc.documentElement.childNodes[0].nodeValue); return(null); } } catch(e) {alert(e.message)} } try { return(xmlDoc); } catch(e) {alert(e.message)} return(null); } xmlDoc=loadXMLDocErr("note_error.xml"); </script> <footer>简单教程,简单编程<br/>Copyright © 简单教程 www.twle.cn</footer>
运行结果: