I have written the following jQuery code:
$('#Submitter').click(function(f) {
x = $('#link').serialize();
$('body').append(x);
$.ajax({
type:POST,
url:"engine.php",
data:x,
success: function(i){
console.log(i);
$('#i').html(i);
}
});
});
Each time after clicking on the <input id="Submitter" type="button" value=Submit>
element, Firefox's console displays the error: ReferenceError: POST is not defined.
Where is the issue and how to resolve this issue?
Thank you.
replace your code like this :
$('#Submitter').click(function(f) {
x = $('#link').serialize();
$('body').append(x);
$.ajax({
type:'POST',
url:"engine.php",
data:x,
success: function(i){
console.log(i);
$('#i').html(i);
}
});
});
POST needs to be enclosed with quotes