Liquid Fire Posted February 3, 2007 Share Posted February 3, 2007 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); } Quote Link to comment Share on other sites More sharing options...
Liquid Fire Posted February 3, 2007 Author Share Posted February 3, 2007 This seems to be happening for all my ajax stuff. basically it will process the first request and then not process anymore request. Quote Link to comment Share on other sites More sharing options...
irken Posted February 4, 2007 Share Posted February 4, 2007 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). Quote Link to comment Share on other sites More sharing options...
Liquid Fire Posted February 4, 2007 Author Share Posted February 4, 2007 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? Quote Link to comment Share on other sites More sharing options...
Liquid Fire Posted February 4, 2007 Author Share Posted February 4, 2007 Finally figured this out, there is a issue in IE wherei need to put the .open before i assign the onreadystatechange a function. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.