HTML - Accelerated Mobile Pages (AMP)

HTML - Accelerated Mobile Pages (AMP)

About

The AMP Project speeds up web pages on mobile devices

AMP HTML is a subset of HTML for authoring content pages such as news articles in a way that guarantees certain baseline performance characteristics.

Required markup

required-markup (also here to make an html AMP.

Javascript

Custom,

https://amp.dev/documentation/guides-and-tutorials/develop/custom-javascript/

Example: Any DOM elements the custom JavaScript files wish to interact with must be wrapped inside the <amp-script> component tags. If you were to call document.body.appendChild(document.createElement('span')) within the script imported into an <amp-script> element in the following document:

<body>  
  <p>Hello!</p>
  <div>
    <amp-script layout="container" src="customjs.js">
    </amp-script>
  </div>
</body>

It would result in this:

<body>  
  <p>Hello!</p>
  <div>
    <amp-script layout="container" src="customjs.js">
      <span></span>
    </amp-script>
  </div>
</body>

Third party

For performance and security reasons, you cannot include third-party JavaScript in AMP pages. For ads, you need to use RTC

Framewor

Documentation / Reference







Share this page:
Follow us:
Task Runner