Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
36
rated 0 times [  37] [ 1]  / answers: 1 / hits: 32971  / 11 Years ago, mon, december 9, 2013, 12:00:00

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 () {});
}

More From » php

 Answers
26

remove the from the name of the properties



$.post (
postdataURL, {
formid:5,
clientid:1,
userid:1,
level:mycat,
extra:mytimer,
pid:pid
},
function () {});


And add a



alert(Got called); 


after



function postData() { 


to be sure the function is being called


[#73833] Saturday, December 7, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
devinjadong

Total Points: 711
Total Questions: 117
Total Answers: 100

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
devinjadong questions
Thu, Feb 17, 22, 00:00, 2 Years ago
Wed, Dec 8, 21, 00:00, 2 Years ago
Tue, Oct 27, 20, 00:00, 4 Years ago
Fri, Oct 18, 19, 00:00, 5 Years ago
;