I have some javascript that sends data to a function that calls a php page, however I get an error that I can't find any information on. The postData() call is in the middle of another plain javascript function. But I can't get it to submit the data to the php page.
function postData() {
var postdataURL = "path/to/php/page.php";
$.post (
postdataURL, {
"formid":5,
"clientid":1,
"userid":1,
"level":mycat,
"extra":mytimer,
"pid":pid
},
function () {});
}
Review your variable mycat, mytimer, pid is may be a jQuery Object. That mean you had asigned
mycat = $('#cate')
If that true, you just fix that
mycat = $('#cate').val()
Or some code get real value.
In my case was the same problem like @user3740976. I put in url an undefined parameter.
$.ajax({
type: requestType,
url: url,
dataType: dataType,
data: dataParams,
...
Where dataParams is
{"title":{},"iSBN":"111","partNumber":"3332","bookCategory":"1"}
title being undefined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With