首页 > 解决方案 > AMP JS 更新是否破坏了 ON 属性?

问题描述

直到今天,我们新的 AMP HTML 网站的本地开发实例进展顺利。我们的 Firebase 实例最后一次更新是 5 月 23 日,但今天我们的本地站点和托管站点都存在 ON 属性问题:

on="tap:AMP.navigateTo(url='https://my_url')"

不会触发具有 ON 属性的按钮元素,错误是:

Uncaught TypeError: Cannot read property 'length' of undefined
at Ga (string.js:79)
at nk.f.handleAmpTarget (resources-impl.js:1513)
at Kg (v0.js:158)
at l (v0.js:157)
at v0.js:157
at Array.forEach (<anonymous>)
at Jg (v0.js:157)
at Fg.f.trigger (event-helper.js:66)
at HTMLDocument.<anonymous> (priority-queue.js:99)

我是在等待 Google 的 AMP 团队解决这个问题,还是我能做些什么?

标签: amp-html

解决方案


已确认 AMP JS 的更改破坏了导航功能。这已得到修复。 https://github.com/ampproject/amphtml/issues/15695


推荐阅读