JSONP 跨域请求

<script>
  let temp = document.createElement("script");
  temp.type = "text/javascript";
  const callback = function(res){
      alert(res);
  }
  temp.src = "http://XXX.XXX.com/YYY?callback=callback";
  document.body.appendChild(temp)  
</script>

 

posted @ 2020-12-22 20:32  `Duet`  阅读(50)  评论(0编辑  收藏  举报