Passing jquery variable with json

前端 未结 2 1260
时光说笑
时光说笑 2021-01-25 02:55

I am trying to pass a jquery string to my cakephp controller but I keep getting an error saying json_decode expects a string but is passed an array.

Here is the code for

2条回答
  •  一向
    一向 (楼主)
    2021-01-25 03:21

    Are you sure the url you use is correct? If you are using CakePHP, then why don't you work with $this->request->data?

    Try to debug your code with

    pr($_POST); exit;
    

    or

    pr($this->request); exit;
    

    What do they say?

提交回复
热议问题