0
到目前爲止我的代碼是如何在HTML發佈使用Ajax
<script type="text/javascript">
var xmlDoc;
var xmlhttp;
function loadRates() {
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = readRates;
xmlhttp.open("GET", "PartialRates.xml", true);
xmlhttp.send();
}
function readRates() {
if (xmlhttp.readyState == 4) {
xmlDoc = xmlhttp.responseXML;
var rateRows = xmlDoc.getElementsByTagName("countryRates");
var totAttributes = rateRows[0].attributes.length;
我如何從我的PartialRates.xml信息到我的HTML?我需要在我的HTML上發佈簡單的費率。
我的XML看起來是這樣的:
<PartialRates>
<countryRates
rate1="[email protected]"
rate2="1-800-588-7886"
rate3="[email protected]"
rate4="1-800-588-7885">
</countryRates>
</PartialRates>
顯示你的HTML的相關部分 – 2015-02-11 01:57:38