阅读文档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)