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
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).

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.