Jump to content

[SOLVED] AJAX Not Working fully in IE 7


Liquid Fire

Recommended Posts

I have a select box and when i selt a name information is display that comes from a database.  thsi work fine using ajax technology in FireFOx but when it IE it partly works.  what i mean by that is when i select a name for the first time(any name will work) it displays the inforamtion but if i switch the name to another one nothing is updated like it would be in FIreFox.  what could be causing this? 

 

here is my javascript code:

function CreateAjaxObject() 
{
if(window.XMLHttpRequest) 
{
	return new XMLHttpRequest();
} 
else if(window.ActiveXObject) 
{
	return new ActiveXObject("Microsoft.XMLHTTP");
}
}

var ajax_object = CreateAjaxObject();

function ValidateProjectName(passed_url, id)
{
//make sure that the browser supports ajax
if(ajax_object == null)
{
	alert("your browser does not support ajax");
}

var url = passed_url + "?id=" + id;

ajax_object.onreadystatechange = ProcessStateChange;
ajax_object.open("GET",url,true)
ajax_object.send(null)
}

function DisplayUserContactInformation(passed_url, id)
{
//make sure that the browser supports ajax
if(ajax_object == null)
{
	alert("your browser does not support ajax");
}

var url = passed_url + "?id=" + id;

ajax_object.onreadystatechange = ProcessStateChange;
ajax_object.open("GET",url,true)
ajax_object.send(null)
}

function ProcessStateChange()
{
//var location = "outside";
if(ajax_object.readyState == 4 || ajax_object.readyState == "complete")
{
	//location = "inside";
	document.getElementById("returned_html").innerHTML = ajax_object.responseText;
}
//alert(location);
}

Link to comment
https://forums.phpfreaks.com/topic/36954-solved-ajax-not-working-fully-in-ie-7/
Share on other sites

Not sure I understand fully, but then again I diden't read it all ;s. Try using a POST request instead, it seems as if it's caching the information somehow, but then not doing the request again maybe because the page is already cached, or something. Always good practise to use POST requests, as nothing will get cached (in IE).

Switching it to post did nothing.  What i read in that if you send non ASC-II characters when not send XML as i am not, that the respondText will not work after the first one which seems to be the case here.  Are there any good tutorails on how to work will xml and how to display it back on the webpage?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.