views:

30

answers:

0

Hi All

I added ajax to a web application with 7 'select' tags, in which selecting an option would populate the following 'select' tags with the related information. And some of these tags can also show another set of radio buttons or checkboxes. In all, you can make more than 10 requests to the server until you get your desired product. All work fine in major browsers except in IE, where the request to the server are limited to 7 times and then nothing happens any more until you refresh the browser to start again. I even tried to disable the cache, but still the same problem occured...

Why is IE doing this nonsense?

This is the ajax code doing the server-client talking:

function updateAvailableAttributes()
{
var xmlhttp;
var form = document.forms["orderDefinition"];
form.elements["formChangeRequest"].value = "true";
var processingMsgBox = $("#waitingMsgOverlay, #waitingMsgBox, #waitingMsg, #waitingMsgParag");
var map = document.getElementById("OrderMap");

if(window.XMLHttpRequest) 
{// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp = new XMLHttpRequest();
}
else 
{// code for IE6 and below
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}

xmlhttp.onreadystatechange = function()
{
    switch(xmlhttp.readyState)
    {
        case 1:
            map.disableApplication();
            processingMsgBox.show();
            break;
        case 4:
            if(xmlhttp.status == 200)
            {
                $('#usercontent .sleeve .toprow').html(xmlhttp.responseText);
                applyValidation();
                browserScrollManagement();
                $("#toolpanel").height($("#orderMap").height());
                inputBtnHighlightSelection();
            }
            else
            {
                sessionTimedOut();
            }

            $("#toolpanel").height($("#orderMap").height());
            map.enableApplication();
            processingMsgBox.hide();
            break;          
    }
}

var parameters = $("form#orderDefinition").serialize();
xmlhttp.open("POST", "ajax/possibleValues.html", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", parameters.length);
xmlhttp.setRequestHeader("Cache-Control", "no-cache");
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.send(parameters);
}