Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Why doens't this AJAX work in IE?
Old 04-23-2009, 03:26 AM Why doens't this AJAX work in IE?
Novice Talker

Posts: 8
Trades: 0
Code:
<script type="text/javascript">
function thediv(){
var xmlHttp;
    try{    
        xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
    }
    catch (e){
        try{
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
        }
        catch (e){
            try{
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e){
                alert("No AJAX!?");
                return false;
            }
        }
    }

xmlHttp.onreadystatechange=function thediv(){
    if(xmlHttp.readyState==4){
        document.getElementById('thediv').innerHTML=xmlHttp.responseText;
        setTimeout('thediv()',500000);
    }
}
xmlHttp.open("GET","blah.php",true);
xmlHttp.send(null);
}

window.onload=function thediv(){
    setTimeout('thediv()',5000);
}
</script>

<div id="thediv">Loading..</div>
It works in every other browser..
XGhozt is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-23-2009, 01:29 PM Re: Why doens't this AJAX work in IE?
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 232
Name: John
Location: Tokyo
Trades: 0
when you open it in IE. what happen? does it show NO AJAX! message?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

if(I'm("Helpful")) Add_Talkupation("nayes84");
nayes84 is offline
Reply With Quote
View Public Profile
 
Old 04-23-2009, 02:01 PM Re: Why doens't this AJAX work in IE?
Novice Talker

Posts: 8
Trades: 0
Nope, it just doesn't load anything..
XGhozt is offline
Reply With Quote
View Public Profile
 
Old 04-23-2009, 02:20 PM Re: Why doens't this AJAX work in IE?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Are you running it on a server or on local files?
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-23-2009, 03:16 PM Re: Why doens't this AJAX work in IE?
Novice Talker

Posts: 8
Trades: 0
It's on one of my web servers, would you like a link to the website? It should work locally too..
XGhozt is offline
Reply With Quote
View Public Profile
 
Old 04-23-2009, 03:45 PM Re: Why doens't this AJAX work in IE?
Novice Talker

Posts: 8
Trades: 0
I figured it out.. :P

Instead of:
Code:
xmlHttp.onreadystatechange=function thediv(){
It should be..
Code:
xmlHttp.onreadystatechange=function(){
Thanks anyway.. lol
XGhozt is offline
Reply With Quote
View Public Profile
 
Old 04-23-2009, 03:51 PM Re: Why doens't this AJAX work in IE?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
ah... yeah, that'll do it. I missed it too
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Why doens't this AJAX work in IE?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51998 seconds with 12 queries