Problema de acentos en ajax
Publicado por edwar2 (3 intervenciones) el 30/11/2006 16:24:19
Hola tengo problemas con los centos y las Ñ ... yo programo en zope y plone y uso el ajax en estas funciones :
function objetoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function pedirDatos(idempleado){
divFormulario = document.getElementById('resultado');
ajax=objetoAjax();
ajax.open("POST",'DMET_Proyecto',true)
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
divFormulario.innerHTML = ajax.responseText;
divFormulario.style.display="block";
}
}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("ID_PROYECTO="+idempleado)
}
me devuelve en la capa div 'resultado' caracteres raros para las Ñ y los acentos ... como hago para que se muestren ...
function objetoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function pedirDatos(idempleado){
divFormulario = document.getElementById('resultado');
ajax=objetoAjax();
ajax.open("POST",'DMET_Proyecto',true)
ajax.onreadystatechange=function() {
if (ajax.readyState==4) {
divFormulario.innerHTML = ajax.responseText;
divFormulario.style.display="block";
}
}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("ID_PROYECTO="+idempleado)
}
me devuelve en la capa div 'resultado' caracteres raros para las Ñ y los acentos ... como hago para que se muestren ...
Valora esta pregunta
0