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
Oh Internet Explorer, how I hate you so... (AJAX Probs)
Old 03-15-2009, 04:31 AM Oh Internet Explorer, how I hate you so... (AJAX Probs)
MoForce's Avatar
Super Talker

Posts: 145
Name: Jack Shalt
Trades: 0
The script works fine in all browsers except IE... I think IE keeps caching the data so ajax isn't working. Any ideas?

This is the script I'm using

Code:
<script type="text/javascript">
<!--  
function test(){
    var ajaxRequest;
      try{
          ajaxRequest = new XMLHttpRequest();
    } catch (e){
          try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                  alert("You don't have javascript?!");
                return false;
            }
        }
    }
      ajaxRequest.onreadystatechange = function(){
        if(ajaxRequest.readyState == 4){
            var ajaxDisplay = document.getElementById('screen');
            ajaxDisplay.innerHTML = ajaxRequest.responseText;
        }
    }
    var itemid = document.getElementById('itemid').value;
    var type = document.getElementById('type>').value;
    var outbound = document.getElementById('outbound').value;
    var inbound = document.getElementById('inbound').value;
    var queryString = "?itemid=" + itemid + "&outbound=" + outbound + "&inbound=" + inbound + "&type=" + type;
    ajaxRequest.open("GET", "sendmsg.php" + queryString, true);
    ajaxRequest.send(null); 
}
//-->
   setInterval(test, 1000);
   </script>
I've got an ajax library too... jquery... so if anyone can help convert the above script into jquery that would be greatly appreciated =) and I think that'll probably fix my IE problem too

Last edited by MoForce; 03-15-2009 at 04:33 AM..
MoForce is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-15-2009, 09:02 PM Re: Oh Internet Explorer, how I hate you so... (AJAX Probs)
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
and I think that'll probably fix my IE problem too
No it won't
IE has problems with reusing the XMLHTTPObject. Basically it doesn't, so looping around to call a remote function will work once, then fail on subsequent calls.

You have to do a bit of javascript "jiggery-pokery" to make it work. see -
http://keelypavan.blogspot.com/2006/...ect-in-ie.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-15-2009, 10:54 PM Re: Oh Internet Explorer, how I hate you so... (AJAX Probs)
MoForce's Avatar
Super Talker

Posts: 145
Name: Jack Shalt
Trades: 0
Quote:
Originally Posted by chrishirst View Post
No it won't
IE has problems with reusing the XMLHTTPObject. Basically it doesn't, so looping around to call a remote function will work once, then fail on subsequent calls.

You have to do a bit of javascript "jiggery-pokery" to make it work. see -
http://keelypavan.blogspot.com/2006/...ect-in-ie.html
"jiggery-pokery" lol sounds like fun... I'll give it a try

I also noticed from the past that if I modify the code slightly then upload it, the file magically works for a while... then when I upload the same file again sometime later it stops. Will this be fixed in IE 8 or future versions?

thanks
MoForce is offline
Reply With Quote
View Public Profile
 
Old 03-16-2009, 05:50 AM Re: Oh Internet Explorer, how I hate you so... (AJAX Probs)
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I had lots of "fun" making it work, or rather making it work was fairly straightforward, getting around the obscure "undocumented feature" that affects IE6 on Win2k (which just happens to be my OS of choice) was the "interesting" bit.

Quote:
I also noticed from the past that if I modify the code slightly then upload it, the file magically works for a while... then when I upload the same file again sometime later it stops. Will this be fixed in IE 8 or future versions?
that sounds like a caching "issue"
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Oh Internet Explorer, how I hate you so... (AJAX Probs)
 

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.14217 seconds with 12 queries