![]() |
|
#1
|
|||
|
|||
|
AJAX with IE8 - returns error c00ce56e
I've been working with AJAX for a few weeks now but I encountered an error with IE8. Since I Wanted to optimize it with all browsers I figured I needed to fix this.
This works great in Firefox 3 and most recent Chrome. This connects to my database, searches for galleries and prints out pictures of the galleries. I've edited http://www.w3schools.com/PHP/php_ajax_database.asp for my own needs. This is where the request start: Code:
<select onchange="showGallery(this.value)"> <option value="test">First gallery</option> </select> Code:
var xmlHttp;
function viewGallery(str)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="../../scripts/v2/site_add.php";
url=url+"?gallery="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("container_site_left_main_content_gallery").innerHTML=xmlHttp.responseText;
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
Code:
document.getElementById("container_site_left_main_content_gallery").innerHTML=xmlHttp.responseText;
Any ideas how to solve this? I use PHP and AJAX. |
| Sponsored Links |
|
#2
|
|||
|
|||
|
Although I've been having this problem for a while I always end up solving the problem right after I post the problem.
edit /etc/php/php.ini and change default_charset = "UTF-8" IE seemed to be very picky about it. works with FF too. Damn me!
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|