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>
<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>