PhoEniX-VooDoo
17-07-2008, 10:07
Ciao ragazzi, spero che qualcuno di voi possa darmi una mano, ho il seguente file/codice ajax:
function CreaOggetto() {
if(document.all) {
//Internet Explorer
var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
} else {
//Mozilla
var XhrObj = new XMLHttpRequest();
} // if(document.all)
return XhrObj;
}
function sendData(param, page, dest)
{
var XhrObj = CreaOggetto();
var content = document.getElementById(dest);
XhrObj.open("get", page+'?'+param);
XhrObj.onreadystatechange = function()
{
if (XhrObj.readyState == 4 && XhrObj.status == 200)
content.innerHTML = XhrObj.responseText ;
}
XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
XhrObj.send(param);
}// fonction SendData
Serve per fare una ricerca incrementale direttamente su un DB.
Il Problema è che le parole accentate mi vengono ritornate come "?" in FireFox e come "quadratini" in IE! :muro:
Come posso risolvere?
INFO
- In phpmyadmin ho settato utf-8 e italian
- Nelle pagine .php ho settato <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- Il problema si presenta solo quando i risultati passano dalla funzione ajax, in query dirette da php sul db nn ci sono problemi.
function CreaOggetto() {
if(document.all) {
//Internet Explorer
var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
} else {
//Mozilla
var XhrObj = new XMLHttpRequest();
} // if(document.all)
return XhrObj;
}
function sendData(param, page, dest)
{
var XhrObj = CreaOggetto();
var content = document.getElementById(dest);
XhrObj.open("get", page+'?'+param);
XhrObj.onreadystatechange = function()
{
if (XhrObj.readyState == 4 && XhrObj.status == 200)
content.innerHTML = XhrObj.responseText ;
}
XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
XhrObj.send(param);
}// fonction SendData
Serve per fare una ricerca incrementale direttamente su un DB.
Il Problema è che le parole accentate mi vengono ritornate come "?" in FireFox e come "quadratini" in IE! :muro:
Come posso risolvere?
INFO
- In phpmyadmin ho settato utf-8 e italian
- Nelle pagine .php ho settato <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- Il problema si presenta solo quando i risultati passano dalla funzione ajax, in query dirette da php sul db nn ci sono problemi.