diff --git a/scripts/fonctions.js b/scripts/fonctions.js index c05c1cf..1ddcc73 100644 --- a/scripts/fonctions.js +++ b/scripts/fonctions.js @@ -178,10 +178,10 @@ function getRandomQuote() { } // Convertis des euros (€) dans une autre devise -function convertCurrency(urlFixerIO, currency, euroValue) { +function convertCurrency(currency, euroValue) { $.ajax({ - url : urlFixerIO, - dataType : "jsonp", + url : 'https://api.exchangeratesapi.io/latest', + dataType : "json", success: function (jsonFixer) { switch(currency) { case '£': diff --git a/scripts/main.js b/scripts/main.js index f495c6e..67a60a9 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -175,8 +175,7 @@ $(function () { else { euroValue = parseFloat(euroValue); - let urlFixer = 'http://data.fixer.io/api/latest?access_key=' + config.APIkeyFixer; - convertCurrency(urlFixer, euroToCurrency, euroValue); + convertCurrency(euroToCurrency, euroValue); } });