I have the following three vars:
var action,
pubMode,
token;
All three values should be submitted via POST and with ajax. Since POST doesn’t take an url I have absolutely no idea how to do so?
function ajaxPost(action, pubMode, token) {
$.ajax({
url: ??,
dataType: "text json",
type: "POST",
success: function(jsonObject,status) {
console.log("function() ajaxPost : " + status);
}
});
}
Can you guys please help me out here! Thank you
$.ajaxhas adataoption where you can pass the variables as on object, or as a query string.POST is not like GET where you tack the variables onto the URL. Use the URL you want to post to as
urland usedatato send the variables.