<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title
</title>
</head>
<body>
<input type="button" onclick="jsonpRequest();" value="跨域请求" />
<script>
TAG = null;
function jsonpRequest() {
TAG = document.createElement('script');
TAG.src = "http://www.jxntv.cn/data/jmd-jxtv2.html?callback=list&_=1454376870403"; // list([11,22,33,44])
document.head.appendChild(TAG);
}
function list(arg) {
console.log(arg);
document.head.removeChild(TAG);
}
</script>
</body>
</html>
转载于:https://www.cnblogs.com/jiefangzhe/p/10783678.html
相关资源:jsonp实现百度下拉框功能的方法分析
转载请注明原文地址: https://win8.8miu.com/read-1450470.html