this is the server side code
<?php
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 01 Jan 2016 00:00:00 GMT');
header('Content-type: application/json');
$id = $_GET['id'];
$data = array("Hello", $id);
echo json_encode($data);
?>
and this is the client side code
<html>
<head>
<script src="jquery-1.1.1.min.js"></script>
<script language="javascript">
function show(json) {
alert(json);
}
function run() {
$.getJSON("/localhost/jserver1.php",
{ id: 567 },
show);
}
window.onload=run;
</script>
</head>
<body>
JSON Test Page.
</body>
</html>
What i want to do here is i want to send messages between client and server using php and json. when i run the server side code i am getting the output as hello with the id given in the url in the localhost,but when i run the client side code i am getting only the body of the html page,I am not getting the alert with the input id that is there in the run method.Please someone tell me what is the problem