이 기사에서는 JS에서 가장 짧은 XML 서식 도구를 구현하는 방법에 대해 설명합니다. 참조를 위해 공유하십시오. 세부 사항은 다음과 같습니다.
E4X가있는 가장 짧은 XML 서식 도구입니다. 불행히도, 즉, 지금 까지이 표준 기능을 지원하지 않습니다 ...
Firefox 또는 Chrome에서 실행하십시오!
1. 코드는 다음과 같습니다.
다음과 같이 코드를 복사하십시오. <html>
<헤드>
<title> intent xml </title>
<script language = "javaScript"type = "text/javaScript"src = "http://code.jquery.com/jquery-latest.js"> </script>
<script language = "javaScript"type = "text/javaScript; e4x = 1">
$ (function () {
$ ( 'button'). 클릭 (function () {
$ ( 'textArea'). val (new XML ($ ( 'textArea'). val ()). eloxmlstring ());
});
});
</스크립트>
</head>
<body>
<div>
<TextArea rows = "8"cols = "40"> </textArea>
</div>
<div> <button> 인트 </button> </div>
</body>
</html>
2. 서식 전 :
3. 서식 후 :
이 기사가 모든 사람의 JavaScript 프로그래밍에 도움이되기를 바랍니다.