From dd212a0ac145bb9820e0773258cbe06b7bf9528f Mon Sep 17 00:00:00 2001 From: Divlo Date: Fri, 13 Sep 2019 23:00:41 +0200 Subject: [PATCH] API Changes - convertCurrency --- scripts/fonctions.js | 6 +++--- scripts/main.js | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) 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); } });