I am sending form data using Ajax
function sendData(){
var formData = $('form').serialize();
$.ajax({
url:'/../admin/ajaxUtility.cfc?method=saveFormData',
data: formData
});
};
Above function works fine but sometimes I am sending huge data which makes url too long.
I am getting '404 Not Found' error with 'XML Parsing Error: no element found Location: moz-nullprincipal:{25f2f525-....} Line Number 1, Column 1:' in console window.
Is their any alternate way to send data using Ajax?
Thank you in advance for your help.
function sendData(){
var formData = $('form').serialize();
$.ajax({
type : "POST", // TRIED THIS ONE ?
url : '/../admin/ajaxUtility.cfc?method=saveFormData',
data : formData
});
} // ';' not needed at this point
I have added POST type and it works fine.
function sendData(){
var formData = $('form').serialize();
$.ajax({
url:'/../admin/ajaxUtility.cfc?method=saveFormData',
type: "POST",
async: true,
data: formData
});
};