首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将Review调用转换为html

将Review调用转换为html
EN

Stack Overflow用户
提问于 2017-03-02 15:34:36
回答 1查看 91关注 0票数 0

我很抱歉麻烦了。我无法将API调用转换为可以在网页上运行的html。

呼叫是这样的:identifier=example-retail-merchant

它产生了这样的东西:

代码语言:javascript
复制
{
  "merchant": {
    "identifier": "example-retail-merchant", 
    "name": "Example Retail Merchant", 
    "url": "http://www.exampleretailmerchant.co.uk", 
    "logo": "example-retail-merchant-logo.png", 
    "review_url": "http://www.feefo.com/en_GB/reviews/example-retail-merchant"
  }, 
  "meta": {
    "count": 3878, 
    "pages": 194, 
    "page_size": 20
  }, 
  "rating": {
    "min": 1, 
    "max": 5, 
    "rating": 4.9, 
    "service": {
      "count": 3878, 
      "1_star": 8, 
      "2_star": 28, 
      "3_star": 0, 
      "4_star": 181, 
      "5_star": 3661
    }, 
    "product": {
      "count": 6240, 
      "1_star": 55, 
      "2_star": 102, 
      "3_star": 0, 
      "4_star": 724, 
      "5_star": 5359
    }
  }
}

谁能给我指个正确的方向吗?

非常感谢你..。

EN

回答 1

Stack Overflow用户

发布于 2022-02-17 19:44:15

根据jQuery,您可以使用以下函数进行API调用:

代码语言:javascript
复制
$(document).ready( function() {
var info;
var whitelisted; 
var quantity;
$.get("https://api.guildwars2.com/v2/commerce/prices/24615",function(obj){
    info = obj['id'];
    whitelisted = obj["whitlelisted"]
    quantity = obj.buys['quantity']
    $("#id1").html("id :"+info);
    $("#whitelist").html("whitelisted :"+whitelisted);
    $("#quan").html("quantity :"+quantity);
  });
});    
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42559584

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档