Hello, Im working with jquery and ASP, and have an SQL database from which I get, using the function $.getJSON(), some descriptions in spanish with "acentos" and "tildes" (á, é, í, ó, ú, ñ, etc.).
With Chrome 4 and FireFox is working fine. The problem is with IE8: with some particular query, it hangs without getting the result back. If I replace all "ó" with "o" using IE, the same resultset works perfect, so I know the problem is with the "acentos" (ó).
Im setting the ajax call with this code:
$.ajaxSetup({'beforeSend' : function(xhr) {
if (xhr.overrideMimeType) {
//FF & Chrome
xhr.overrideMimeType('text/html; charset=iso-8859-1');
}else {
//IE8
//I tried everything here:
//xhr = new ActiveXObject("Microsoft.XMLHTTP");
//var obj = new ActiveXObject("MSXML2.XMLHTTP.3.0");
//xhr = new ActiveXObject("Msxml2.XMLHTTP");
//and get ERROR with IE8 in this line:
xhr.setRequestHeader('Content-type', 'text/html; charset=iso-8859-1');
}
}
});
And then, the call to getJSON() to get the descriptions with "acentos" is like this:
function showDialog(idCriterio, codAplica, descTema){
$("#dialog-modal").html("Buscando Datos...");//getting data...
$.getJSON("generarJSONTipos.asp", { idCriterio: idCriterio, codAplica: codAplica},
//callback function
function(data){
var textoDialogo;
textoDialogo= "";
$("#dialog-modal").html("<span class='tituloOpcion'>"+descTema+"</span><br><br>");
for(i=0;i<data.length;i++) {
//tomo el html actual
textoDialogo = $("#dialog-modal").html();
//le apendo la descripcion del elemento del array
$("#dialog-modal").html(textoDialogo + data[i].descripcion + "<br>");
}//end for
}//end callback
);//end getJSON
$("#dialog-modal").dialog({
height: 300,
width:450,
modal: true
});
$("#dialog-modal").dialog('open');
}
Any hints will be apreciated. I have googled for days, without getting to the answer to this question... :P
Thanks in advance, Ignacio (La Plata, Argentina)