Tizag Webmaster Forums  

Go Back   Tizag Webmaster Forums > Web Development > Client-Side Scripting Forum > AJAX Forum

Reply
 
Thread Tools Display Modes
  #1  
Old 04-06-2009, 03:04 PM
deukalion deukalion is offline
Newbie
 
Join Date: Dec 2008
Posts: 29
deukalion will become famous soon enough
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>
This is the AJAX .js file

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;
}
And then in IE8 I get a error c0056e, row 24 error which is this line:

Code:
document.getElementById("container_site_left_main_content_gallery").innerHTML=xmlHttp.responseText;
As I've said, this works in every browser but IE8 and I have a similar function for news search and it worked with IE7 now it gives me the same error as the gallery.

Any ideas how to solve this?

I use PHP and AJAX.
Reply With Quote
Sponsored Links
  #2  
Old 04-06-2009, 03:26 PM
deukalion deukalion is offline
Newbie
 
Join Date: Dec 2008
Posts: 29
deukalion will become famous soon enough
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!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:08 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2008, Tizag