Forum Moderators: open
I am new in Ajax but I bought some books and tried few basic things in my WIP website... I was very happy by the result until I installed IE7 to test my work.
I keep having the following error in IE7
"Could not complete the operation due to error c00ce56e"
It looks like an encoding problem. It seems that the problem is because in my environment everything (Apache, Mysql, content) has been set to UTF-8 (use of mb_internal_encoding("UTF-8"); and mysql_query("SET NAMES 'utf8'");).
My ajax is very basic.
onclick event -> open PHP page -> do request in mysql -> return responseText using innerHTML
Works great in FF, Opera but not IE7.
I have tried to force the page that handle the request to use UTF-8 by placing a header('Content-type: text/html; Charset=utf-8'); but it does not help...
Any idea, any work-around or any help would be appreciated.
I tried to google but results are very poor, so I am sure that WW's guru will have the solution.
Thanks
I just post the solution in case some of you is having a similar error in IE7...
I'll personnally call this a BUG.
I had to remove the two following from my header
//$charset="utf-8";
//header("Content-Type: text/html; charset=\".$charset.\"");
But I have left the two following line as it is.
mb_internal_encoding("UTF-8");
$connect=@mysql_connect("$server","$user","$pass") or die ("Unable to connect server");
$db_select=@mysql_select_db("$database") or die ("Unable to get table");
mysql_query("SET NAMES 'utf8'");
Works in IE7, FF and Op. now.
The downside is that I need to have another header (with baseurl, environment data, password, databases, tables, etc...) specifically for php page called using AJAX. So, if one day, I must change something (like changing host or password), then I have to change it twice now... RRRRRR!
Thanks