Last active
December 18, 2015 05:18
-
-
Save marceloxp/5731211 to your computer and use it in GitHub Desktop.
AjaxRequest
This file contains 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
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