ZTree.com  | ZEN  | About...  

 Index   Back

History manipulation   [Discuss]

By: Martijn Coppoolse   Homepage   Voorburg, NL  
Date: Apr 29,2016 at 03:17
In Response to: History manipulation (Peter Shute)

> > https://notepad-plus-plus.org/community/topic/237/editing-600-mega-xml-file/10
> > > Odd behaviour on that page. As I scroll up and down (in Firefox), the
> > > URL in the address bar changes to match the URL of each post. How?
> >
> > I suspect this is done using History.pushState:
> >
> > https://html.spec.whatwg.org/multipage/browsers.html#the-history-interface
> I'm slightly uncomfortable with JavaScript(?) changing the URL. It
> works in IE 11 and Edge, but when I tried it with IE 8, it won't even
> load the page.

That's due to an unrelated error: the page wants to load javascr*** files using the require, which isn't supported by older browsers. Since there's no error handling in place, the page simply stops loading. After skipping those errors (using the F12 developer tools), the page loads just fine on my machine.
That site has obviously not been written for, or tested with, IE8.

> > It allows linking directly to a specific post on the page.
> Yes, I was surprised to see that when I pasted the link into the forum
> reply, it already had the post's anchor appended.

It also allows going back and forth with the back button without actually leaving the page, which is very handy nowadays on sites where an entire application runs within a single page.


Thread locked

Messages in this Thread

94,751 Postings in 11,947 Threads, 348 registered users, 16 users online (0 registered, 16 guests)
Index | Admin contact |   Forum Time: Feb 25, 2020 - 8:27 pm EST  |  Hits:30,128,413  (8,021 Today )
RSS Feed