1 Star 0 Fork 0

feng/test_page

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.html 797 Bytes
一键复制 编辑 原始数据 按行查看 历史
yangzhengfeng 提交于 2018-01-07 15:56 +08:00 . update
<html>
<head>
<title>跨域测试</title>
<script src="http://www.w3school.com.cn/jquery/jquery-1.11.1.min.js"></script>
<script>
//回调函数
function showData (result) {
var data = JSON.stringify(result); //json对象转成字符串
$("#text").val(data);
}
$(document).ready(function () {
$("#btn").click(function () {
//向头部输入一个脚本,该脚本发起一个跨域请求
$("head").append("<script src='http://192.168.122.254/cc.json?callback=showData'><\/script>");
});
});
</script>
</head>
<body>
<input id="btn" type="button" value="get_data" />
<textarea id="text" style="width: 400px; height: 100px;"></textarea>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yf33/test_page.git
git@gitee.com:yf33/test_page.git
yf33
test_page
test_page
master

搜索帮助