2022年9月8日

两个非同源页面之间通信,postMessage

摘要: ####http://127.0.0.1:3000/a.html <iframe id="frame" src="http://127.0.0.1:3001/b.html"></iframe> <script> iframe.onload = function() { iframe.contentW 阅读全文

posted @ 2022-09-08 02:10 In-6026 阅读(186) 评论(0) 推荐(0) 编辑

跨域解决方法

摘要: ##jsonp ####原理:利用了img,link,script,iframe标签都不存在跨域限制的特点,使用script标签传递函数 ####大致步骤:前端把一个函数(func)传递到后端,后端做字符串拼接,得到 "func('一段文字')" 的字符串,发送回前端后,前端就会执行 func('一 阅读全文

posted @ 2022-09-08 02:03 In-6026 阅读(22) 评论(0) 推荐(0) 编辑

导航