The AMP documentation mentions using jQuery with the amp-script component: https://amp.dev/documentation/guides-and-tutorials/develop/custom-javascript/
However, I do not see any examples nor an explanation of how to do so.
I've tried including jQuery in the example AMP pages below (3.4.1 and 2.2.4 respectively), and running this simple jQuery script:
$('button').click(function() {
$('body').append('hello world');
})
Example AMP pages:
https://apps.yourstorewizards.com/sandbox/amp/amp-script/jquery3.html https://apps.yourstorewizards.com/sandbox/amp/amp-script/jquery2.html
Neither work as expected. Both produce javascript errors. Are there limitations as to which jQuery functions can be used in AMP?
Any help would be appreciated. Thanks.