用javascript實作post送Xml

  1. 用javascript實作post送Xml
    1. 參考資料

用javascript實作post送Xml

原文連結: https://darkblack01.blogspot.com/2016/06/javascriptxml.html
移植時的最後更新日期: 2016-06-16T10:56:48.684+08:00

就這樣,然後想辦法把XML字串丟進來吧!

function send() {
var xml = ‘’;

var xmlhttp = new XMLHttpRequest();
xmlhttp.open(“POST”, “http://localhost/”, true);
xmlhttp.send(xml);
}
[1]
xmlhttp.open(用POST, 傳去哪個網址, true);
xmlhttp.send(XML字串); 測試頁面
<html>
<head>
<title>test</title>
<script type=“text/javascript” src=“test.js”></script>
</head>
<body>
<button onclick=send()>Go!!</button>
</body>
</html>

參考資料

[1] How to send a specialized XML request in JavaScript