Skip to content

Instantly share code, notes, and snippets.

@marceloxp
Last active December 18, 2015 05:18
Show Gist options
  • Save marceloxp/5731211 to your computer and use it in GitHub Desktop.
Save marceloxp/5731211 to your computer and use it in GitHub Desktop.
AjaxRequest
function AjaxRequest(args)
{
try
{
$.ajax
(
{
url: "arquivo.php",
type: "POST",
data:
{
"dt1" : 1,
"dt2" : 2
}
}
).done
(
function(data)
{
if (data == "OK")
{
}
else
{
alert("Falha na captura da imagem");
}
}
).fail
(
function(jqXHR, textStatus)
{
alert("Falha: " + textStatus);
}
);
}
catch(err)
{
alert("Erro: " + err.message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment