Sending JSON jQuery Ajax to PHP and back

后端 未结 4 1978
借酒劲吻你
借酒劲吻你 2021-01-27 12:46

I\'m having problems sending a JSON jQuery array via Ajax to a PHP script. What is the problem here:

var tee = $(\'#voting_image img\').attr(\'id\');
var vote =          


        
4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-27 13:05

    AFAIK, there is no $.toJSON method in jQuery, you are probably looking for $.parseJSON and by the way you are already creating JSON here:

    var thing = {tee: tee, vote: vote};
    

提交回复
热议问题