相关疑难解决方法(0)

我应该将json结果放在money.js中?

阅读文档http://openexchangerates.github.io/money.js/#fx.rates 它说你需要设置你的费率:

 fx.base = "USD";
fx.rates = {
    "EUR" : 0.745101, // eg. 1 USD === 0.745101 EUR
    "GBP" : 0.647710, // etc...
    "HKD" : 7.781919,
    "USD" : 1,        // always include the base rate (1:1)
    /* etc */
}
Run Code Online (Sandbox Code Playgroud)

我完全得到,只有这些将是静态费率.它说要有动态速率你需要添加json api:

// Load exchange rates data via AJAX:
    $.getJSON(
      // NB: using Open Exchange Rates here, but you can use any source!
      'http://openexchangerates.org/api/latest.json?app_id=[I hid this number]', function(data) {
        // Check money.js has finished loading:
        if (typeof fx !== …
Run Code Online (Sandbox Code Playgroud)

javascript json currency money.js

2
推荐指数
1
解决办法
918
查看次数

标签 统计

currency ×1

javascript ×1

json ×1

money.js ×1