history.js

history.js plugin - how to use

夙愿已清 提交于 2019-12-19 04:23:37
问题 I need a hand with the history.js plugin. I put together a brief page to test the functionality - http://www.salesmelbourne.com/ Currently I'm struggling with the following: Back/forward buttons don't reload the AJAX div - is this an extra history.js function that I haven't added or do I need to code this myself? or both. I notice when the title updates it flashes - I believe its briefly showing the page meta title. Can I make this smooth? IE (I'm using verison 9) shows a popup box on each

How Does Github Do pushState Without Hash Tags?

大兔子大兔子 提交于 2019-12-18 10:29:35
问题 I've been researching the best way to utilize HTML5's history api aka psuhState with a proper fallback for HTML4 browsers. Github uses the history api for its tree browsing (the following link is just an example, not the library github uses): https://github.com/browserstate/History.js/ What I can't figure out is how they handle this functionality for HTML4 browsers such as Firefox 3.5? I've looked at, specifically, history.js (linked above) to handle this sort of thing. But it requires a hash

How do I actually use history.js on my site

淺唱寂寞╮ 提交于 2019-12-18 10:10:19
问题 I've read all the posts about history.js on stackoverflow including, this, this and this and at looked the source code but as a newcomer to javascript/jquery I'm having trouble figuring out how to actually implement to have html 5 history support and fallback to support html4 browsers such as ie8/9. As I can appreciate the UX benefits from presenting consistent URL's as much as possible, how this solves deep linking and allows for bookmarking I want to implement but I get a bit lost when

How can I detect the back/forwards buttons being clicked when using History.js?

∥☆過路亽.° 提交于 2019-12-18 05:55:12
问题 Im using History.js (click) with jQuery in my code. When loading new content via ajax i use: History.pushState({my:stateobject},"newtitle","supernewurl"); This seems to work since the URL is updated in the browser. However, I don't get it where I can hook up my code whenever a back or forward button is pressed. Which method/event is used for this? 回答1: You need to bind an event handler to the statechange event, like this: $(window).bind('statechange',function(){ // Do something, inspect

browser back and forward button does not invoke callback method with statechange event of history.js

穿精又带淫゛_ 提交于 2019-12-18 05:06:06
问题 I used (https://github.com/browserstate/history.js) and have a piece of code like this History.Adapter.bind(window, 'statechange', function() { var State = History.getState(); alert('Inside History.Adapter.bind: ' + State.data.myData); }); function manageHistory(url, data, uniqueId){ var History = window.History; if ( !History.enabled ) { return false; } History.replaceState({myData: data}, null, '?stateHistory=' + uniqueId); } if I invoke manageHistory() after my ajax call, then History

Statechange is firing whenever i do a push-state

∥☆過路亽.° 提交于 2019-12-18 04:34:22
问题 I am using history.js to handle back button. In history.js statechange is firing whenever i do a pushstate. Why? 回答1: According to this discussion on github, it's expected behaviour of history.js This pull request claims to have modified history.js to be more inline with W3C Specs. 回答2: Wanted to add, yes this is the expected behaviour of History.js. At the same time there are more discussions that critize this behaviour as it is not the W3C standard and does create some confusion. In short,

Does Ember routing fall back to using a hash if browser doesn't support the History API?

主宰稳场 提交于 2019-12-18 04:09:31
问题 Ember documentation states that it can be set to use the History API for routing rather than hash-based fragments by using: App.Router.reopen({ location: 'history' }); But I can find no mention of what will happen if a browser doesn't support the History API. Will it fall back to using a hash like History.js? If not, should I check for History API support and switch history implementation to hash if it isn't supported? 回答1: There doesn't seem to be any History API support detection in the

pushState() and popState(): manipulating browsers' history

大城市里の小女人 提交于 2019-12-17 22:43:34
问题 I am working on a small project in which I want to create an Ajax-style website. Content is loaded with jQuery's load() . As some of you know, the down side of this is that the URL does not change accordingly to the content that is displayed. To make this work you can use pushState() . Because this is not cross-browser supported, I used the plug-in history.js . This is working quite nicely, but the problem is that my back and forward buttons are not working as they should and I have no idea

Stop History.js from changing the address URL

你。 提交于 2019-12-13 04:42:44
问题 I've been experimenting with History.js lately (https://github.com/browserstate/history.js/). I notice when you use the History.pushState(), History.js removes everything upto the first / and replaces that with the hash. I.E. current url: www.google.com/something History.pushState({},null,"something2"); sets the address bar to www.google.com/something2 whereas in HTML4 it would use the hash (#) -> www.google.com/something#something2 Is there anyway to disable this feature. I'l like it to not

How to use the History API or history.js to change the “active” link appropriately when the page is refreshed or when the back button is pressed?

会有一股神秘感。 提交于 2019-12-13 04:41:20
问题 My active (opened) links are highlighted with JS . <script type="text/javascript"> $(document).ready(function(){ $("a.nav1").click(function() { $(".active").removeClass("active"); $(this).addClass("active"); }); }); </script> links example <div id="navigation"> <ul> <li><a class="nav1" data-tab="#home" id="link-home"href="#home">Home</a></li> <li><a class="nav1" data-tab="#football" id="link-football" href="#football">Football</a></li> <li><a class="nav1" data-tab="#hockey" id="link-hockey