Answer the question
In order to leave comments, you need to log in
How to display the exchange rate in this ajax?
Good time of the day.
Tell me how to display the exchange rate in this ajax
Here is the ajax code
$.ajax({
method: 'GET',
url: 'js/currency.php',
success: function(response){
var json = JSON.parse(response);
json.Valute.forEach(function(e){
if (e['@attributes'].ID == 'R01235') console.log(e.Value);
});
}
});
Answer the question
In order to leave comments, you need to log in
Here you can read how to round a number or bring it to the form you need.
To assign a number to a variable:
if (e['@attributes'].ID == 'R01235') var cur = e.Value;
And output this number to some input:
use jQuery
$('#id_iput').val(cur);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question