Skip to content

Instantly share code, notes, and snippets.

@rturowicz
Last active December 15, 2015 07:59
Show Gist options
  • Save rturowicz/5227763 to your computer and use it in GitHub Desktop.
Save rturowicz/5227763 to your computer and use it in GitHub Desktop.
JQuery ajax
$.post('/faq/next/',
{'zmienna':'wartosc'},
function(data) {
alert(data.question);
},
"json"
);
$.ajax({
type: "POST",
url: '/ajax/importfiles',
data: {'definition':$('#type').val()},
dataType: "json",
contentType: 'application/x-www-form-urlencoded',
complete: function(data) {
var ret = $.parseJSON(data.responseText);
}
});
$. getJSON({
url: '/ajax/importfiles',
data: {'definition':$('#type').val()},
dataType: "json",
success: function(data) {
var ret = data;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment