I have a script where, after selecting the first select it returns me in the second select the country currency, but those countries and currencies when you have special characters are bringing me "Bosnia and Herzegovina"
script.js
$(document).ready(function () {
var paises = null;
var moedas = null;
$.ajax({
type: "GET",
url: "../paises.json",
contentType: "application/json ; charset=UTF-8",
cache: false,
success: function(retorno) {
paises = retorno;
$.each(paises,function(i, pais){
$('#pais').append($('<option>', {
value: paises[i].sigla_moeda,
text: paises[i].pais
}));
});
}
});
$('#pais').change(function(){
$("#moeda").empty();
$.ajax({
type: "GET",
url: "../moedas.json",
contentType: "application/json ; charset=UTF-8",
cache: false,
success: function(retorno) {
var moedas = retorno;
$.each(moedas,function(i, moeda){
if($('#pais').val() === moedas[i].sigla){
$('#moeda').append($('<option>', {
value: moedas[i].sigla_moeda,
text: moedas[i].moeda
}));
}
});
}
});
})
Thank you!