1

Ajax returning HTTP response 501: method not implemented [closed]

view story
linux-howto

http://stackoverflow.com – I am requesting a simple php file that echos a single line; using AJAX, but I am getting a HTTP 501 response from my localhost server on linux. My question is, What could be causing this kind of error? JavaScript: var request = new XMLHttpRequest(); request.onreadystatechange = function () { //console.log(request.responseText); if (request.readyState == 4 && request.status == 200) { console.log(0); } else if (request.status == 501) { console.log(request.responseText); } } request.open('test.php', 'GET', true); request.send(); test.php: <?php ec (HowTos)