问题描述
- ajax的跨域访问快递接口
- 访问一个快递查询接口;
html如下:<!DOCTYPE html><html><head><meta charset=""UTF-8""><title>Insert title here</title><script type=""text/javascript"" src=""js/jquery-1.8.2.min.js""></script><script type=""text/javascript"">$(function(){ $(""#btnCrossDomainRequest"").click( function(){ var url = 'http://api.ickd.cn/?id=109113&secret=89f3f9f42a70268ccf2ee966674fed1d&com=zhongtong&nu=6108241734&type=json&encode=utf-8&jsoncallback=?'; $.getJSON(urlfunction(data){ console.log(data); }); } );})</script></head><body><button id=""btnCrossDomainRequest"">点击</button></body></html>
解决方案
时间: 2024-12-30 01:01:39