Add Javascript in AMP Pages

前端 未结 5 1332
灰色年华
灰色年华 2020-12-06 02:37

Please help me understand how to add javascript in the AMP (Accelerated Mobile Pages). My requirement is I get an ID in URL. For example localhost:8080/home?id=1.I would lik

5条回答
  •  天涯浪人
    2020-12-06 03:22

    Custom javascript is disallowed on AMP pages, and is one of the founding principles of AMP. You can put custom js within an amp-iframe, as long as the amp-iframe is xdomain'd from the main page.

提交回复
热议问题