Skip to content

Instantly share code, notes, and snippets.

@elecay
Last active December 20, 2015 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elecay/6062962 to your computer and use it in GitHub Desktop.
Save elecay/6062962 to your computer and use it in GitHub Desktop.
Ajax de consulta XML
<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