WordPress json api插件——从jQuery调用

时间:2022-08-22 11:11:34

I am using JSON API Plugin for wordpress. It generates a json file from my wordpress content at http://grmmph.com/?json=1.

我正在为wordpress使用JSON API插件。它从我的wordpress内容http://grmph .com/?json=1生成一个json文件。

It seems to work fine if from the link above, however when I am trying to call it with jQuery, it doesn't get any call.

如果从上面的链接来看,它似乎可以正常工作,但是当我尝试使用jQuery调用它时,它没有任何调用。

        var url = "http://grmmph.com/?json=1&count=1"; 
        jQuery.getJSON(url, function() {
        alert('Test!'); // Test if it is even working, not alert appears.
    });

Any ideas? maybe a better json plugin for wordpress?

什么好主意吗?也许wordpress有更好的json插件?

1 个解决方案

#1


0  

I remember I struggled in the past to find the good way to use JSON with Wordpress and be able to fetch the result using jQuery. I hope the answer I wrote (and accepted) will be helpful for you.

我记得我过去曾努力寻找使用JSON使用JSON的好方法,并且能够使用jQuery获取结果。我希望我写的(和接受的)答案对你有帮助。

result of get_the_content() not correctly displayed

get_the_content()的结果没有正确显示

#1


0  

I remember I struggled in the past to find the good way to use JSON with Wordpress and be able to fetch the result using jQuery. I hope the answer I wrote (and accepted) will be helpful for you.

我记得我过去曾努力寻找使用JSON使用JSON的好方法,并且能够使用jQuery获取结果。我希望我写的(和接受的)答案对你有帮助。

result of get_the_content() not correctly displayed

get_the_content()的结果没有正确显示