Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-02-2010, 08:36 PM   PM User | #1
brenops
New to the CF scene

 
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
brenops is an unknown quantity at this point
Ajax not working with IE. Other browser are working fine.

I have the following ajax code that is working fine in all browsers except ie. I don't get any error message. Does anyone know what is wrong?

<script language="javascript">
var xmlhttp;
function showDispachers(str) {
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null) {
alert ("Browser does not support HTTP Request");
return;
}
var url="showDispachers.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged() {
if (xmlhttp.readyState==4) {
document.getElementById("idDispacher").innerHTML=xmlhttp.responseText;
}
}

function GetXmlHttpObject() {
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject) {
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
</script>

Thanks in advance
brenops is offline   Reply With Quote
Old 08-02-2010, 08:49 PM   PM User | #2
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
THis thread needs to be moved to the Ajax forum. Also Brenops, you need to use the code tags in your post to make your code readable.
__________________
Fumigator is offline   Reply With Quote
Reply

Bookmarks

Tags
ajax, internet explorer, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 +1. The time now is 02:50 PM.


Advertisement
Log in to turn off these ads.