PHP接收JSONPHP、JSON

由网友(趁我病~拿我命)分享简介:我使用的是淘汰赛,这是我的ajax code:I'm using knockout and this is my ajax code:save: function() {$.ajax({url:"http://localhost/loyalty/welcome/json/",type: "post",data: k...

我使用的是淘汰赛,这是我的ajax code:

I'm using knockout and this is my ajax code:

save: function() {
                $.ajax({
                    url:"http://localhost/loyalty/welcome/json/",
                    type: "post",
                    data: ko.toJSON(this),
                    contentType: "application/json",
                    success: function (result) { alert(result) }
                });
            }

用Firebug我可以看到JSON消息被正确发送,问题是如何得到它PHP,究竟是什么已发送的名字?

Using firebug I can see that the json message is sent correctly, the problem is how to receive it on PHP, what is the name of what has been sent?

我用codeIgniter

I'm using CodeIgniter

在此先感谢您的帮助。

推荐答案

解决的办法是采取

contentType: "application/json",

从AJAX调用。

from ajax call.

=)

阅读全文

相关推荐

最新文章