How to Add custom JavaScript in AMP Template

Add custom JavaScript in AMP Template

In this Article we will discuss how to add custom JavaScript in amp template.

To add custom JavaScript in AMP template, you must write it in JavaScript file (e.g. amp-iframe.js). 

Add custom JavaScript in AMP Template
Add custom JavaScript in AMP Template

Then add this JavaScript script to <head>:

 <script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>{codeBox}


Custom JavaScript can be using as amp-script

<amp-script>

Paste Your JavaScript Here

</amp-script>{codeBox}


Custom JavaScript Can Be Use As AMP-Iframe:

<amp-iframe >

Paste Your JavaScript Here

</amp-iframe>{codeBox}


Other Method That Can Be Use

<amp-script layout="responsive" src="Paste Your JavaScript Url Here">

  </amp-script> {codeBox}

I Hope Now You Will Understand How to Add Custom JavaScript In Amp Page or Templates .

Hope It Will Helpful For You....

*

Post a Comment (0)
Previous Post Next Post