xxxxxxxxxx
<!DOCTYPE html>
<html>
<title>JSONP 使用脚本标签请求JSON示例 - 基础教程(div.cn)</title>
<body>
<h2>使用脚本标签请求JSON </h2>
<p> PHP文件返回对" myFunc()"的调用,该调用将处理JSON数据:</p>
<p id="output"></p>
<script>
function myFunc(myObj) {
document.getElementById("output").innerHTML = myObj.name;
}
</script>
<script src="jsonp_demo.php"></script>
</body>
</html>