To JSON and json_decode in PHP and JavaScript

后端 未结 3 1356
别跟我提以往
别跟我提以往 2021-01-21 00:33

I\'m trying to pass a JavaScript object to a PHP script through jquery.ajax(), basically:

var bigArray = new Object();
//Dode
//Start loop
bigArray[         


        
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-21 00:59

    Turn processData to true. I don't believe your JSON is being passed through correctly. Also note that it won't come through as a json, but rather the key value pairs of your JSON will be the contents of $_POST when you get to it.

    Also, are the values of your bigArray easily convertable to string? If you're passing in DOM elements or something, you're going to have issues.

提交回复
热议问题