测试跨域html

<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script>
$.getJSON("http://xxx:1078/jt808/terminal/list", function(data) {
  console.log(data);
}).done(function(ok) {
  console.log("ok....");
      console.log(ok);
}).fail(function(fail) {
  console.log("errs");
   console.log(fail);
});


$.getJSON( "http://xxx:1078/jt808/terminal/list", function(dat) {
    console.log(data);
}).done(function(ok) {
  console.log("ok2....");
      console.log(ok);
}).fail(function(fail) {
  console.log("errs2");
console.log(fail);
});

$.ajax({
    url: "http://xxx:1078/jt808/terminal/list",    //请求的url地址
    dataType: "jsonp",   //返回格式为json
    async: true, //请求是否异步,默认为异步,这也是ajax重要特性
    data: { "id": "value" },    //参数值
    type: "GET",   //请求方式
    beforeSend: function() {
        //请求前的处理
         console.log('beforeSend');
    },
    success: function(req) {
        console.log(req)
        alert('ok');
    },
    complete: function(com) {
        console.log(com)
        //请求完成的处理
        console.log('complete');
    },
    error: function(err) {
        console.log(err)
        //请求出错处理
         console.log('error');
    }
});
</script>

111111111111111111111111111
<!--<iframe src="https://blog.csdn.net/"></iframe>-->
<iframe src="http://xxx:1078/jt808/terminal/list"></iframe>
222222222222222222

  • 5
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值