redmellow Posted October 2, 2015 Share Posted October 2, 2015 Yes I'm a newbie in AJAX '&&' JavaScript. As I'm a pupil here, I find hurdle almost in any code... There is an AJAX code with some number value in it, like 4 - 200, but I can't understand the nature of this digits or what they are indicating... function loadDoc() { var xhttp; if (window.XMLHttpRequest) { // code for modern browsers xhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 200) { document.getElementById("demo").innerHTML = xhttp.responseText; } You see: "== 4 && xhttp.status == 200)" ... what for? Thanks to anyone who'll reply to this 'double-dumb' question!! Link to comment Share on other sites More sharing options...
dsonesuk Posted October 2, 2015 Share Posted October 2, 2015 As clearly explained herehttp://www.w3schools.com/ajax/ajax_xmlhttprequest_onreadystatechange.asp 1 Link to comment Share on other sites More sharing options...
redmellow Posted October 2, 2015 Author Share Posted October 2, 2015 I found it in this right moment, while reading the lesson! I just had to wait few more pages.. Thank you dsonesuk!! Cheers!!! Link to comment Share on other sites More sharing options...
Ingolme Posted October 2, 2015 Share Posted October 2, 2015 They are HTTP codes, for a complete list, look here: http://www.w3schools.com/tags/ref_httpmessages.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now