Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
101
rated 0 times [  105] [ 4]  / answers: 1 / hits: 25823  / 11 Years ago, wed, november 6, 2013, 12:00:00

When i click run button show this error in chrome console and don't alert anything



POST http://mysite/gd/add.php 503 (Service Unavailable) 


enter



index.php



<html>
<head>
<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js></script>
</head>
<body >
<script>
function go(){
$.ajax({ url: 'add.php',
data: {'q': ''},
type: 'post',
success: function(output) {
alert(output);}
});
}
</script>
<button onclick=go();>Run</button>
</body>
</html>


add.php



<?php echo Hello; ?>

More From » php

 Answers
30

I have tried your code in local environment, it is working fine. The reason for 503 error because of the Web server (running the Web site) is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. Some servers in this state may also simply refuse the socket connection, in which case a different error may be generated because the socket creation timed out.

user2511140 : I add this code to show errors.my server is to busy and show error.i changed server and problem solved



$.ajax({ url: 'add.php',
type: 'post',
data: {'q': ''},
success: function(output) {
alert(output);},
error: function (request, status, error) {
alert(request.responseText);},
});
}

[#74479] Tuesday, November 5, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sabinal

Total Points: 144
Total Questions: 112
Total Answers: 107

Location: Ghana
Member since Mon, Aug 22, 2022
2 Years ago
;