IE and Ajax problems...

They have: 140 posts

Joined: Nov 2003

I recently had a site coded which has a location search feature where people select a US state from a menu and then a list of cites appears. It uses ajax to present some information.

The site works great with firefox but locks up or takes FOREVER in IE.

Is anyone familiar with a way to address this so it works the same in IE ?

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

can you post the Javascript code that goes and gets the info from the server then puts it in the webpage?

-Greg

247SiteAlert's picture

They have: 18 posts

Joined: Oct 2007

You're saying this lockup happens when you try to use one of the Ajax features or no?

They have: 140 posts

Joined: Nov 2003

yes... when it is using some ajax features. I have the programmer working on it and will let you know what happens.... tks.

247SiteAlert's picture

They have: 18 posts

Joined: Oct 2007

Just a shot in the dark - the create request object is tricky for IE vs the other browsers so when I started learning Ajax a year ago it took me a while to find a good, robust and workable function - I have listed it below in case you need it.

<?php
function createRequestObject() {
    if (
window.XMLHttpRequest) { // Mozilla, Safari, Opera...
       
var xmlhttp = new XMLHttpRequest();
        if (
xmlhttp.overrideMimeType)
           
xmlhttp.overrideMimeType('text/xml');
    }
    else if (
window.ActiveXObject) { // IE
       
try {
            var
xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");
        } catch (e) {
            try {
                var xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");
            } catch (e) {}
        }
    }

    if (!xmlhttp) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    return xmlhttp;
}
?>

Free Website Uptime Monitoring
http://www.247SiteAlert.com

They have: 140 posts

Joined: Nov 2003

here is the site in question: housingmarketupdate.com

it appears that a (IE) users cache gets filled and locks up the selectable menus or impedes the loading of data. it makes it seem like the thing is not working... but in firefox it flys.

that code that 247 posted... is that something that should go in every page or just one? The programmer said he uses something similar but I can't understand why this site is having these problems while others with similar features do not.

i'd be happy to post code for anyone who wants to look at it. Also... IE 7 seems to be the worst....

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.