Does AMP HTML allow unofficial custom elements

放肆的年华 提交于 2019-12-08 22:00:15

问题


Will an AMP page work with an unofficial custom component?

I can imagine getting an official one is best for spreading usage but for just 1 site which wants to program in some custom component does it need to get its component approved as official or it can just make one and include it in its own code?

https://github.com/ampproject/amphtml/blob/master/spec/amp-html-components.md


回答1:


No. An unofficial custom component would have to break the "AMP-conforming content may not have any JavaScript." constraint.

I'd suggest either following the approach described in the "Service-specific JavaScript built-in to a component" section: https://github.com/ampproject/amphtml/blob/master/spec/amp-html-components.md or working with the project to get your desired component included.



来源:https://stackoverflow.com/questions/33672611/does-amp-html-allow-unofficial-custom-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!