4

My AJAX is not working and I cannot figure out why. What am I missing??

ReferenceError: xmlhttp is not defined @ javascript.js:5

    function insapts(pin){
        if (window.XMLHttpRequest){ xmlhttpp=new XMLHttpRequest(); }else{ xmlhttpp=new ActiveXObject("Microsoft.XMLHTTP"); }
        xmlhttpp.onreadystatechange=function(){
            if(xmlhttpp.readyState==4 && xmlhttpp.status==200){
                document.getElementById('apttimeins').innerHTML = xmlhttp.responseText;
            }
        }
        var url = "bridge3.php?pin="+pin;
        xmlhttpp.open("GET",url,false);
        xmlhttpp.send(null);
    }

1 Answer 1

6

You have a typo. The XMLHttpRequest object is created with the local variable name xmlhttpp.

Change

 xmlhttp.responseText;

to

xmlhttpp.responseText;
//     ^ missing p
Sign up to request clarification or add additional context in comments.

1 Comment

I can understand.. A fresh pair of eyes is always helpful :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.