Open mwzip opened 11 years ago
If you are loading the rates like in the jquery ajax examples make sure you call fx only after that.
Another point is about where are you calling fx, you can try to call it using window.fx and check if works.
call it using window.fx
:+1: Works for me.
Im having the same problem... my page wont load even after I call the window.fx
I feel I must be missing something. Please help!!
Hi,
I am having the same problem... "Uncaught fx error please guide me how to solved this error IF possible tell me where to write code to fix this.
My Website URL :- http://vandvshop.com/production/
I am in trouble pls help me
Thanks!
Was this issue ever resolved? I'm having the same problem.
same problem here
Try using other currencies. Like fx.convert(1000, {from: "GBP", to: "HKD"});
if it works then the problem is in your JSON response. It can't find the currency you are trying to convert. I just noticed this on my current project.
I ended up resolving my issue, by looking at the money js source code. The line in question was:
// Throw an error if either rate isn't in the rates array
if ( !rates[to] || !rates[from] ) throw "fx error";
There was no "from" value set in fx.settings, so setting it to my base currency seemed to fix that issue:
fx.settings = { from: "USD"};
. I also had to set the fx.convert function within the function where I make my JSON request and use bind(this) to bind the data.
I don't understand what's happening, but it's not working
Same issue
Same issue
Same issue
same issue
+1
You'll need to wait until the AJAX request has completed before you can begin processing conversions.
If you can't do that, then set default rates ( not the latest / local array of rates), then when you get your ajax request response replace that array with the latest rates.
MoneyConverter.base = "USD"; MoneyConverter.rates=[ "AED": 3.673123, "AFN": 69.469, "ALL": 105.04, "AMD": 478.652004, "ARS": 20.1765] axios .get("api/currencies/rates";) .then(function(response) { MoneyConverter.rates = response.data.data; })
Hello,
money.js seems like a great library, but I can't seem to get it working. No matter what, I always get: "Uncaught fx error" as the javascript console output and the conversions don't seem to be working.
I get this error on a fresh page with just money.js included and the BASIC convert() function being called. To be more specific, the error also says: "b.convert (anonymous function)"
Any ideas?