Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
306 views
in Technique[技术] by (71.8m points)

html - What can cause Anchor Links to reload the page?

Recently, I've been working on a WordPress website powered by the Divi theme and builder. Some of the pages have a menu with the URLs set to ID's of certain sections of the page (anchor links) but when clicked, the page refreshes and then scrolls to the relevant section.

What would cause a page to refresh when an anchor link is clicked? I'm baffled!

I've tried changing the URLs (to the below) but still have the same problem. https://www.domain.co.uk/tables/#breakpoint-one https://www.domain.co.uk/tables#breakpoint-one

In static HTML, coding something like this would take a matter of minutes so I cannot understand why the page refresh occurs.

question from:https://stackoverflow.com/questions/65599681/what-can-cause-anchor-links-to-reload-the-page

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Is the refreshing ocurring only the first time you click on an anchored link? or does it happen every time.

Perhaps you have POST data present (like you arrived on the page after submitting a form). I think the behaviour you describe matches that scenario.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...