I have below jquery reading xml,
but not sure why below alert statement is not working.
Alert("HI " + bondState);
function fnGetBondAmount() {
$.ajax({
url: "http://localhost:5489/BondList.xml",
success: function (xml) {
parseSelectXMLBondAmountList(xml, "bondAmount", "CA", "Contractor")
},
error: function (xhr, ajaxOptions, thrownError) {
alert("Status: " + xhr.status);
alert("Error: " + thrownError);
}
});
}
function parseSelectXMLBondAmountList(xml, selectid,bondState,bondName) {
var selecthtml = '', selectBondName, selectedbondAmountType;
$('#' + selectid).prop("disabled", false);
$(xml).find(xmlnode).each(function () {
if (bondState == $(this).find('GeneralInformation').find('State').text()) {
alert("HI " + bondState);
}
});
}
<?xml version="1.0" encoding="utf-8"?>
<Surety>
<SuretyLine>
<Commercial>
<Bond>
<GeneralInformation UI="BondInfo">
<State ID="bondState" PrefillValue="Yes">CA</State>
<Product>A</Product>
</GeneralInformation>
<GeneralInformation UI="BondInfo">
<State ID="bondState" PrefillValue="Yes">CA</State>
<Product>B</Product>
</GeneralInformation>
<GeneralInformation UI="BondInfo">
<State ID="bondState" PrefillValue="Yes">TX</State>
<Product>C</Product>
</GeneralInformation>
</Bond>
</Commercial>
</SuretyLine>
</Surety>
Open in new window