Amp html 帧通信
在Amp html 帧通信,amp-html,Amp Html,在amp-iframe中有一个amp-script,我想通过postMessage、更改src URL等从script.js到iframe页面进行通信 <amp-script src="//path/to/script.js"> <div>TEXT HERE</div> <amp-iframe height="100" layout="fixed-height" sandbox="allow-scripts
amp-iframe
中有一个amp-script
,我想通过postMessage
、更改src URL等从script.js
到iframe页面进行通信
<amp-script src="//path/to/script.js">
<div>TEXT HERE</div>
<amp-iframe
height="100"
layout="fixed-height"
sandbox="allow-scripts allow-top-navigation"
allowfullscreen
frameborder="0"
src="//path/to/iframe.html">
</amp-iframe>
</amp-script>
此处文本
正确的方法是什么?由于postMessage
对我不起作用,因此通过amp-bind
更改URL不起作用,因为更新时错过了用户交互
想法是阅读此处的文本
,并以某种方式将其传递给iframe
有什么想法吗?有什么解决办法吗?