HTML
路过火车
这个作者很懒,什么都没留下…
展开
-
iframe通信方法 传递数据 window.postMessage的使用
我们在开发过程中,会遇到有需求,在A页面中嵌套一个iframe的B页面,B页面需要发消息给A页面,A页面接收消息,做出相应的处理。这时我们就需要postMessage和addEventListener进行配合使用用法window.postMessage(message, targetPage, [transfer])message: 将要发送到其他 window的数据targetPage:通过窗口的origin属性来指定哪些窗口能接收到消息事件,其值可以是字符串"*"(表示无限制)或者一个URI。原创 2020-07-07 19:37:25 · 1512 阅读 · 0 评论 -
iframe框架的使用
在开发过程中会遇到需要引入其他页面,并在其他页面上层悬浮divindex.html<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title></title> </head> <style> #box { he...原创 2019-05-14 15:21:15 · 26573 阅读 · 0 评论