87,910
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; chatset=utf-8" />
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script language="javascript">
function show(json) {
alert(json);
}
$(document).ready(function() {
$.getJSON(
"test.php", // The server URL
{ id: 567 }, // Data you want to pass to the server.
show // The function to call on completion.
);
});
</script>
</head>
<body>
JSON Test Page.
</body>
</html>
看起来是因为你html文件用的是ascii编码格式的原因,先用记事本打开index.html,然后另存问,注意在名字下面,有一个下拉菜单,选择UTF8编码,
再把文件的代码改成这样试试看。