无法通过rest api读取json变量
Cant reading json variables trough rest api
我在通过rest api 读取变量json时遇到问题
问题:
我的儿子
….
"Featured_media":11661,
"Comment_status"、"open"
"Ping_status"、"open"
"地理位置城市":["Oeiras"],
"_links":{
"自我":[{
"Href":"http:''/''/website.com''/wp-json''/wp''/v2''/lists''/11660"
…..
我可以用这个代码读取所有变量less geolocation_city
$.getJSON('http://imaginocharme.com/wp-json/wp/v2/listings/11660', function (jd) {
$('#stage').html('<p> Nome: ' + jd.featured_media + '</p>');
console.log(jd.featured_media);
$('#stage').append('<p>Descrição : ' + jd.comment_status + '</p>');
console.log(jd.comment_status);
$('#stage').append('<p>Nome : ' + jd.ping_status + '</p>');
console.log(jd.ping_status);
$('#stage').append('<p>Cidade : ' + jd.geolocation_city + '</p>');
console.log(jd.geolocation_city);
$('#stage').append('<p>Links : ' + jd._links.self[0].href + '</p>');
console.log(jd._links.self[0].href);
});
我的控制台日志
11661
index.html (29,29)
open
index.html (31,29)
open
index.html (33,29)
undefined
index.html (35,29)
http://imaginocharme.com/wp-json/wp/v2/listings/11660
index.html (37,29)
我尝试了几种方法来读取变量geolocation_city,并且总是给出未定义的
有人能帮忙吗
知道吗
jd.geolocation_city.toString()
相关文章:
- Javascript-如何读取json文件中的列并将其保存在Javascript数组中
- 正在读取JSON,数据未显示
- 使用jquery读取Json数据
- 如何使用jquery ajax和jsonp在您自己的域上读取json数据
- 使用Angular读取JSON
- 修改d3.js圆环图以读取json数组
- 读取 json 文件 Javascriot 后返回一个数组
- 使用Javascript和PHP读取JSon字符串
- 无法通过rest api读取json变量
- 从d3.js中的文件读取json数据不起作用
- Uncaught SyntaxError:尝试读取json数据时出现意外数字
- 以javascript中的字符串形式从服务器读取json文件
- 使用angularjs中的JSONObject读取json
- 单击按钮时使用JS读取JSON文件
- 如果没有JavaScript中的jQuery,我如何读取.json文件
- javascript在读取JSON文件后无法迭代数组
- 使用 Javascript 读取 JSON 对象(错误)
- JQuery 如何读取 JSON 缓存
- 从 PHP 读取 json 响应并推送到 javascript 多维数组中
- 当我不知道密钥的名称时,如何读取 JSON 对象