Last active
December 20, 2015 03:19
-
-
Save elecay/6062962 to your computer and use it in GitHub Desktop.
Ajax de consulta XML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Ajax request XML</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<script> | |
$(document).ready(function() | |
{ | |
$.ajax({ | |
type: "POST", | |
url: "xml.xml?nocache=" + Math.random(), | |
dataType: "xml", | |
data: '<WSInTRM xmlns="WEBSERVICES"><Origen> cccc </Origen><Tramite> nnnnnnnnnnnn </Tramite> <Operacion>01</Operacion><Celular> 09nnnnnnn </Celular><Monto> nnnnnn </Monto></WSInTRM>', | |
success: parseXml | |
}); | |
}); | |
function parseXml(xml) | |
{ | |
cosole.log(xml.find("ErrorCod").text()); | |
cosole.log(xml.find("ErrorMSG").text()); | |
cosole.log(xml.find("NroTramiteResonance").text()); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment