type: 'GET', url: 'https://www.youtube.com/ajax.php?type=" + type, cache: false, success: function(data) { if (data) changeYTContent(data, track) } code example
Example 1: jquery ajax post
$.ajax({
type: "POST",
url: url,
data: data,
success: success,
dataType: dataType
});
Example 2: jquery $.post
var jqxhr = $.post( "example.php", function() {
alert( "success" );
})
.done(function() {
alert( "second success" );
})
.fail(function() {
alert( "error" );
})
.always(function() {
alert( "finished" );
});
jqxhr.always(function() {
alert( "second finished" );
});