How To Make GET call on page load in Accelerated Mobile Pages

728 Views Asked by At

I want to make a GET call to a third party API on page load in AMP-HTML page. Any help in this regard will be highly appreciated.

EDIT: I am using functions inside script tag in HTML (which is calling third party API internally) to fetch the data based on certain parameters passed to function and the data received is used to display in tabular format.

1

There are 1 best solutions below

0
Sebastian Benz On

There are two components which allow making a GET request on page load:

  • amp-list
  • amp-access

However, you need to make sure that the 3P API supports AMP CORS.