开发者

Configure page based on address bar location

开发者 https://www.devze.com 2023-03-29 17:36 出处:网络
I\'d like to build a site similar to http://www.20thingsilearned.com/ in the respect that an address typed into the address bar does not send the user to a new page, but configures the 开发者_如何学编

I'd like to build a site similar to http://www.20thingsilearned.com/ in the respect that an address typed into the address bar does not send the user to a new page, but configures the 开发者_如何学编程running application instead. Flip through their book and you'll notice the address bar location changing, but you're obviously not sent to new pages... you stay within the running application, which I would assume lives in only one location on the server. And you can use those addresses to jump to specific pages within the app. How is this happening? I assume it takes some server side magic. Any clues as to what is going on is appreciated!


The site you mention is built with spiffy new features of HTML5, specifically the History API. With HTML5 (in newer browsers), you can manipulate the address bar and browser path despite making asynchronous requests. More here: http://diveintohtml5.ep.io/history.html


They are using the HTML5 History API. See Manipulating the browser history (the section on "Adding and modifying history entries").

0

精彩评论

暂无评论...
验证码 换一张
取 消