我无法从html页面调用任何php页面。请告诉我这是什么问题。谢谢。 这是我的html页面:
<!DOCTYPE html>
<html><head>
<title>Login</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#btnLogin").click(function() {
$.ajax({
url: "http://localhost/test.php",
success: function(outputfromserver) {
alert("data received");
},
error: function(jqXHR, textStatus, errorThrown) {
alert("Error type" + textStatus + "occured, with value " + errorThrown);
}
});
});
});
</script>
</head>
<body>
<div id="loginDiv">
<input type="submit" id="btnLogin" value="Login"><br>
<div id="dataDiv">
</div>
</div>
</body>
</html>
这是我的php页面:
<?php
echo "hello world";
?>