Ajax, not sending querystring data

Posted by Tom Gullen on Stack Overflow See other posts from Stack Overflow or by Tom Gullen
Published on 2010-06-17T15:29:16Z Indexed on 2010/06/17 15:33 UTC
Read the original article Hit count: 203

Filed under:
|
    var http = false;

    // Creates xmlhttp object
    if (navigator.appName == "Microsoft Internet Explorer") {
        http = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        http = new XMLHttpRequest();
    }
    http.onreadystatechange = function() {
        if (http.readyState == 4) {
            alert(http.responseText);
        }
    }

    // Functions to calculate optimum layout etc.
    function compute() {
        var statusSpan = document.getElementById("cwStatus");
        document.getElementById("fader").style.display = "";
        document.getElementById("computingWait").style.display = "";

        statusSpan.innerHTML = "<b>Status:</b> Realigning sattelites"
        http.open("GET", "alg.aspx?cr=8&cc=7&sq=3,3", true);

        http.send(null);
    }

This code sort of works, but the querystring data isn't being passed through. It keeps returning an ASPX error page which only happens when there is no querystring data.

Thanks for any help

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about AJAX