p" /> p" /> p"/>

Anchor tag in AMP page reloads entire page

2.9k Views Asked by At

I have the following hyperlink on an AMP page, it's a link to an anchor further down on the page:

<a href="https://www.example.com/venues/amp#party">party</a>

The anchor tag is present too: <a name="party"></a>

Now when the user is on URL https://www.example.com/venues/amp and clicks the hyperlink, the entire page reloads and shows https://www.example.com/venues/amp#party

I don't want the page to reload, I just want to jump to the anchor tag like in a regular web page, so why is this happening? Testing Chrome on Windows 10.

1

There are 1 best solutions below

0
Bachcha Singh On BEST ANSWER

Change the following

<a href="https://www.example.com/venues/amp#party">party</a> 

to

<span role="button" tabindex="0" on="tap:customId.scrollTo(duration=500, position=top)"> Go to Target </span>

and

<a name="party"></a>

to

 <span id="customId"></span>

Click here for example

For more information Click Here