Last active
June 9, 2017 16:30
-
-
Save reginaldojunior/81e0e59de146605a301ca827c4f2124e to your computer and use it in GitHub Desktop.
teste.php
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
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<input name="botao" id="btnSubmit" /> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
// pega o evento click do btn de id="btnSubmit" | |
$('#btnSubmit').click(function(){ | |
$.ajax({ | |
url: 'http://127.0.0.1/agrvai/save.php', | |
data: {}, | |
method: 'POST', | |
dataType: 'JSON', | |
success: function(data) { | |
console.log(data); | |
//retorno dos dados da tratativa do php | |
} | |
}); | |
}); | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment