Skip to content

Instantly share code, notes, and snippets.

@rodrigobravo
Last active June 23, 2017 18:52
Show Gist options
  • Save rodrigobravo/310857bb9db345cac8bd5f6761e8573a to your computer and use it in GitHub Desktop.
Save rodrigobravo/310857bb9db345cac8bd5f6761e8573a to your computer and use it in GitHub Desktop.
$("#botaoMesa").on("click",function()
{
console.log("teste");
var xmlString = "<?xml version='1.0'?><methodCall><methodName>RequestServer.GetTableState</methodName><params><param><value><i4>112</i4></value></param><param><value><i4>1649267442702</i4></value></param></params></methodCall>";
testaPost();
});
$('input[name=mesa]').keydown(function(e)
{
if(e.which == 9) $('#botaoMesa').click();
});
function testaPost(){
$.ajax({
url: "http://10.0.0.124:8080/RPC3",
data: "<?xml version='1.0'?><methodCall><methodName>RequestServer.GetTableState</methodName><params><param><value><i4>112</i4></value></param><param><value><i4>1649267442702</i4></value></param></params></methodCall>",
type: 'POST',
contentType: "text/xml",
dataType: "text",
success: function(retorno)
{
console.log(retorno);
},
error : function (xhr, ajaxOptions, thrownError){
console.log(xhr.status);
console.log(thrownError);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment