Google AMP html - 插入没有src属性的amp-iframe [英] Google AMP html - insert amp-iframe without src attribute

查看:180
本文介绍了Google AMP html - 插入没有src属性的amp-iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在AMP页面中运行脚本。

I'm trying to run a script inside an AMP page.

我无需在 src中加载​​页面属性;我的脚本应该使用正确的 src 注入< iframe> (首次加载时未知,仅收到回复我的脚本提出的请求。)

There is no page I need to load within the src attribute; my script should inject an <iframe> with the correct src (it is unknown at first load, only received in response to a request made by my script).

这可能在AMP吗?

免责声明:我'我可以采用不同的方法来实现相同的结果 - 在AMP中使用 src 属性注入< iframe> 页面。

Disclaimer: I'm open to different approaches to accomplish the same result - injecting an <iframe> with an src attribute within an AMP page.

谢谢

推荐答案

AMP页面不能包含任何内容首先是javascript,所以这不起作用: https:// www.ampproject.org/docs/reference/spec.html#html-tags

The AMP page cannot contain any javascript in the first place, so this won't work: https://www.ampproject.org/docs/reference/spec.html#html-tags

这篇关于Google AMP html - 插入没有src属性的amp-iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆