1 Star 0 Fork 0

吴宇娜/my_nana

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
06.体验jQuery中的JSONP.html 927 Bytes
一键复制 编辑 原始数据 按行查看 历史
吴宇娜 提交于 2021-05-15 22:52 . 提交消息
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="./lib/jquery-v3.6.0.js"></script>
<!-- <script src="http://www.liulongbin.top:3006/api/jsonp?name=zs&age=20&callback=xxxxx"></script> -->
<script>
$(function () {
// 发起 JSONP 的数据请求
$.ajax({
// 指定要发起 JSONP 请求
dataType: 'JSONP',
url: 'http://www.liulongbin.top:3006/api/jsonp',
// 通过 jsonpCallback 来自定义回调函数的名字
jsonpCallback: 'show123456',
// 要提交给服务器的数据
data: {
name: 'zs',
age: 20
},
success: function (res) {
console.log(res)
}
})
})
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wu-yuna/my_nana.git
git@gitee.com:wu-yuna/my_nana.git
wu-yuna
my_nana
my_nana
master

搜索帮助