history.js

Html4 browsers does not support history.pushState and history.replaceState methods of History API from HTML5

穿精又带淫゛_ 提交于 2019-12-03 08:40:23
I am working on an ember application (using ember-1.0.pre.js). And I'm trying to provide cross browser compatibility on IE8. The issue is with url generate after every transition, it seems incorrect/falsy to user. Let say I hit the url like the_ domain_name/sell/new which initially land me to on sell page of our application. and then i tries to transit a new state called "Purchase" which will land me on purchase page of our application. The new state transition generates a URL the_ domain_name/sell/new#/offers/purchase?& suid=1365149991779013736531657156165 in IE8 addressbar instead of the

IE not firing popstate when hashchange happens

断了今生、忘了曾经 提交于 2019-12-03 06:21:47
I have page that is doing the routing on clientside, using history API & push/popstate. Which works just fine on all the modern browsers. (search engines will be supported by node.js prerenderer) However, I recently bumped into issue where IE doesn't fire popstate on hashchange while, while pushstate with urls works just fine, including IE11. For example, like so... $(document).on('click', 'a', function(e) { e.preventDefault(); History.pushState({}, '', $(this).attr('href')); }); ...which correctly fires... $(window).on('popstate', function() { console.log('url changed'); }); According the W3C

Restoring content when clicking back button with History.js

£可爱£侵袭症+ 提交于 2019-12-03 06:04:26
问题 I've implemented History.js on a local test application. Everything seems to work, however if I press the back button in the browser, the previous content does not get restored. Do I actually have to load the content manually again (i.e. make another ajax call) when user presses the back button? Then how does github do it? I see they don't make another ajax call when clicking back button in the code tree. Here is my code: History.Adapter.bind(window,'statechange',function() { var State =

Implementation of History.js

谁说我不能喝 提交于 2019-12-03 04:22:38
问题 I am trying to implement History.js for my ajax site so that I can use forward and back buttons and even bookmarks. However the example @ https://github.com/browserstate/History.js/ has me a bit confused as into how to implement it. Does anyone have a simple tutorial or example on how to use this. An example we can use to start the example is a navigation link such as <script type="text/javascript"> window.onload = function() { function1(); }; <ul> <li><a href="javascript:function1()"

Restoring content when clicking back button with History.js

与世无争的帅哥 提交于 2019-12-02 19:29:33
I've implemented History.js on a local test application. Everything seems to work, however if I press the back button in the browser, the previous content does not get restored. Do I actually have to load the content manually again (i.e. make another ajax call) when user presses the back button? Then how does github do it? I see they don't make another ajax call when clicking back button in the code tree. Here is my code: History.Adapter.bind(window,'statechange',function() { var State = History.getState(); History.log(State.data, State.title, State.url); }); $('a').each(function(index, link)

Implementation of History.js

给你一囗甜甜゛ 提交于 2019-12-02 17:46:46
I am trying to implement History.js for my ajax site so that I can use forward and back buttons and even bookmarks. However the example @ https://github.com/browserstate/History.js/ has me a bit confused as into how to implement it. Does anyone have a simple tutorial or example on how to use this. An example we can use to start the example is a navigation link such as <script type="text/javascript"> window.onload = function() { function1(); }; <ul> <li><a href="javascript:function1()">Function1</a></li> <li><a href="javascript:function2('param', 'param')"</a></li> </ul> I had trouble fully

back button inside a iframe using history.js

流过昼夜 提交于 2019-12-01 12:30:23
I am doing a project in RoR. That project is inside a iFrame. In that iframe have forward and back button. When I click backward button, the iframe content should go back but not the whole browser page. I am using " histroy.js " plugin. But I don't know how to use it. My code is this: $('#back-btn').on('click', function () { History.back(); }); $('#forward-btn').on('click', function () { History.forward(); }); $("a").click(function () { n = 1; q = n++; var s = $(this).attr("href"); var o = 'History.pushState({state:' + q + ',rand:Math.random()}, "State 1", \"' + s + '\");' $("#z").empty()

back button inside a iframe using history.js

只谈情不闲聊 提交于 2019-12-01 11:59:14
问题 I am doing a project in RoR. That project is inside a iFrame. In that iframe have forward and back button. When I click backward button, the iframe content should go back but not the whole browser page. I am using " histroy.js " plugin. But I don't know how to use it. My code is this: $('#back-btn').on('click', function () { History.back(); }); $('#forward-btn').on('click', function () { History.forward(); }); $("a").click(function () { n = 1; q = n++; var s = $(this).attr("href"); var o =

Is there a way to tell what direction the state is going with history.js?

允我心安 提交于 2019-12-01 01:08:18
问题 Like the title says, I'd like to be able to perform a different onstatechange event if the pushState function is called, instead of the back function. Or, if the go function is negative or positive. Example: if History.pushState() or History.go(1) are called, i want the statechange event's callback to be forwardPushState if History.back() or History.go(-1) are called, i want the statechange event's callback to be backwardsPushState 回答1: A state is some data related to a page (as the user see

history.js plugin - how to use

。_饼干妹妹 提交于 2019-12-01 00:57:31
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 page change saying 'message from the website' - kind of like an error - can I sort this somehow? Also