response from server

Posted by john on Stack Overflow See other posts from Stack Overflow or by john
Published on 2010-03-11T15:45:49Z Indexed on 2010/03/11 18:04 UTC
Read the original article Hit count: 139

Filed under:
|

When I create request to the server:

<script language="javascript" type="text/javascript">
function ajaxFunction()
var ajaxRequest;
try{
ajaxRequest = new XMLHttpRequest();
} catch (e){
try{
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
alert("Your browser broke!");
return false;
}
}

} ajaxRequest.onreadystatechange = function(){

if(ajaxRequest.readyState == 4){

document.write(ajaxRequest.responseText);

document.myForm.time.value = ajaxRequest.responseText;
    }
}
ajaxRequest.open("GET", "http://www.bbc.co.uk", true);
ajaxRequest.send(null); 

}

</script>

Why response is nothing? Why response isnt html code of this web site?

© Stack Overflow or respective owner

Related posts about response

Related posts about xmlhttprequest