I am Implementing AMP in my side but i am gating Error:
The tag 'script' is disallowed except in specific forms. please tell me to remove this Error.
I am Implementing AMP in my side but i am gating Error:
The tag 'script' is disallowed except in specific forms. please tell me to remove this Error.
The best way is using the scripts outside the AMP in amp-iframe
Add amp-iframe helper inside head
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
make an iframe call using https://ampbyexample.com/components/amp-iframe/ be sure to sandbox="allow-scripts allow-same-origin"
you will note that it won't work if you are calling the iframe from the same origin so you should use another origin
for example if your domain example.com use
<amp-iframe width="500"
height="281"
layout="responsive"
sandbox="allow-scripts allow-same-origin"
allowfullscreen
frameborder="0"
src="https://iframe.example.com/script">
</amp-iframe>
not all the features will work as expected without JavaScript inside the webpage however I admit that amp-html make the websites faster
Script is not allowed in amp document. Better use the amp components if they match your requirements. You can find the details of amp components here: https://www.ampproject.org/docs/reference/components