DEV Community

Cover image for Javascript History API
Deveesh Shetty
Deveesh Shetty

Posted on

Javascript History API

This is a submission for DEV Challenge v24.03.20, One Byte Explainer: Browser API or Feature.

Explainer

Want to mess with history?

Well, you can, at least in JavaScript. Check out the History API, to go front and back the browser page
history.forward() - for next page
history.back() - for previous page

You can try it in the browser console as well.

Additional Context

I recently found it while exploring Web APIs in MDN docs, it is quite handy if you are working with vanilla HTML, and want to go back and forth in browser sessions.

Full document - History API MDN

Thank you for reading!

Deveesh Shetty
Github | Twitter

Top comments (0)