-1

I am looking to implement special functionality for my website, where loading a page that has multiple other consecutive pages (such as a search result) pre-loads the next page into the browser, accessible via the "forward" button. This sort of functionality is seen on the MSN News website; see the following screenshot.

A screenshot of a webpage with the next page preloaded.

I am looking to have this functionality implemented through JavaScript on a static deployment, as in, the server would just send everything client side. Is this at all possible? Where could I look for documentation for such a thing? I have already attempted to search for the answer to this inquiry elsewhere with no avail. Thanks in advance.

Alex Fanat
  • 748
  • 10
  • 22

1 Answers1

0

I'd avoid looking to use the forward button as its not a primary target but rather preload links on the page like the next button, but rather do it through something called InstaClick. If you're looking to specifically target the forward button itself best place to look is at the History API but thats browser specific. I've attached Mozillas doc on this.

https://developer.mozilla.org/en-US/docs/Web/API/History_API

http://instantclick.io/

https://github.com/dieulot/instantclick

Dustin Snider
  • 678
  • 1
  • 8
  • 29
  • 1
    Instantclick seems interesting for use in other projects; however, since I will be attempting to implement this functionality using a "Single Page Application" (SPA) framework, I don't believe that preloading the next page will help very much, if at all with what I am trying to accomplish. I have upvoted because of the link to the Mozilla documents about the History API, which is what I was looking for. I will likely post an answer myself. – Alex Fanat Aug 30 '18 at 06:38