As the title mentions, my readyState isn't changing from 0 therefore my onreadystatechange function isn't happening, I've been combing over this for the past two hours and I'm stumped!
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
>
<
html>
<
head>
<
title>Ajax Test</title>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<
script type="text/javascript">
function 
fetchData(url,dataToSend,objectID){
    var 
pageRequest false;
    if (
window.XMLHttpRequest)pageRequest = new XMLHttpRequest();
    else if (
window.ActiveXObjectpageRequest = new ActiveXObject("Microsoft.XMLHTTP");
    else return 
false;
    
pageRequest.onreadystatechange = function() {
        var 
object document.getElementyById(objectID);
        if(
pageRequest.readyState==4){
            
object.innerHTML pageRequest.responseText;
        }        
    }
    
alert(pageRequest.readyState);
    if(
dataToSend) {
        var 
sendData 'sendData='+dataToSend;
        
pageRequest.open('POST',url,true);
        
pageRequest.setRequestHeader('Content-Type''application/x-www-form-urlencoded');
        
pageRequest.send(sendData);
    }
    else{
        
pageRequest.open('GET',url,true);
        
pageRequest.send(null);
    }
}
</
script>
</
head>
<
body>

<
input type="button" onClick="fetchData('dataPage.php', false, 'message');" value="Click me!">
<
div id='message'>&nbsp;</div>
</
body>
</
html
Thanks in advance to all who help me!