history.js

Implementing History.js HTML4 Fallback

痞子三分冷 提交于 2019-12-10 13:29:35
问题 The jQuery plugin HISTORY.js (https://github.com/browserstate/History.js/) provides a HTML5 history push implementation feature and in case of an unsupporting browser, should be able to implement a HTML4 hashtag feature. The documentation/README file details the usage as so: var History = window.History; // Note: We are using a capital H instead of a lower h if ( !History.enabled ) { // History.js is disabled for this browser. // This is because we can optionally choose to support HTML4

history.js and header redirection

≯℡__Kan透↙ 提交于 2019-12-10 11:12:42
问题 I'm having problems with history.js, which I don't know how to address. On the website I'm working on we're using history.js to move between pages - if you click on any link history.js loads URL via AJAX, updates the URL and creates transition effect for content. However, we've got also index page with items; if you click on an item, history.js is not used - the content is loaded via ajax and displayed within the popup. There's also a situation where user can open the URL of the item (for

Comparison between Sammy.js/History.js/Nav.js [closed]

三世轮回 提交于 2019-12-09 06:42:48
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I was looking around for Single Page navigation handlers. Sammy.js was bit okay to crack so i created a sample SPA with proper

using history.js with IE9

隐身守侯 提交于 2019-12-08 07:54:18
问题 In one of my applications i use window.history.pushState() method to update the window URL. But as IE < 10 does not support HTML5's history api, I was looking for an alternative. Answers to a lot of other questions on SO suggested to use history.js plugin. From the documentation provided by the history.js plugin it's usage is not really clear. I have added the plugin to the <head></head> section in my templates but on IE9 i am still receiving the error that says: SCRIPT438: Object doesn't

Responding differently to different url changes with history.js

*爱你&永不变心* 提交于 2019-12-08 06:58:44
问题 I'm using history.js, and want to call content via ajax when the url changes. I have that working, but the issue is that I need the page to respond differently depending on what URL is loaded when the state changes. For example, within a local scope, I need the pages related to URLs on the right hand nav to load into the content area next to them. If the URL changes to a scope outside of the section I'm in, I want the ajax call to load pages in a container that contains the whole section,

How do you remove query params from the current route?

这一生的挚爱 提交于 2019-12-08 06:29:49
问题 I have a /cart route that accepts a couple of query params called validate and email . They’re only used when a user isn’t logged in and are unnecessary when they are. In the latter case I would like to remove them from the URL. This is my current onEnter function for the /cart route: const requireCartLogin = (props, replace) => { const { email, validate } = props.location.query; // Exit process if the 'validate' query isn’t present. if (typeof validate === 'undefined') { return; } if (

HTML 5 - Ajax popstate and pushstate

て烟熏妆下的殇ゞ 提交于 2019-12-06 13:18:38
问题 I am trying to figure out how to use this pushstate and popstate for my ajax applications. I know there are some plug ins but i am trying to learn how to use it in it's raw form at the moment. I am also aware that in the raw form it is not supported by IE. All that aside, I need some help understanding how to use it. the pushstate portion of it is pretty simple. Right now i have: function loadForm(var1,var2){ string = "xyz="+var1+"&abc="+var2; history.pushState("", "page 1", string); } This

Is there a way in History.js to know when the back button was pressed

丶灬走出姿态 提交于 2019-12-06 03:07:05
问题 I've started to test History.js. After understanding how it works and that there is no popstate , instead there is statechange . I'm looking for a way to differ when the back button of the browser has been pressed. The reason is that I need to know the URL before the state moved, from the one I'm going to. With the gist the project includes, only the URL we go to is looked. I hope the solution is not to track latest URL visited in a global variable. Thanks 回答1: I found the solutions on github

rails ajax_pagination couldn't find file 'history'

六眼飞鱼酱① 提交于 2019-12-05 19:46:38
I have installed ajax_pagination gem from https://github.com/ronalchn/ajax_pagination When I restart my server i get this message couldn't find file 'history' (in /Users/user/.rvm/gems/ruby-1.9.3-p362/gems/ajax_pagination-0.6.3/lib/assets/javascripts/ajax_pagination.js.erb:3) and inserted calls in assets manifests, rails version is 3.2.8 I had tried installing a history gem ( https://github.com/philostler/historyjs-rails ) or adding history.js to assets but nothing helps Thanks for any help! This appears to be a bug in the jquery-historyjs gem, which ajax_pagination depends on. You may want to

Is it possible to use HTML5's pushState() across multiple domains?

醉酒当歌 提交于 2019-12-05 17:34:46
I have almost impossible problem, but I am hoping someone could come up with some working solution or workaround. I have a website where I use History.js to do on-demand page changes to prevent loading full page when clicking on links. My website however has multiple domains, so cross-domain policy doesn't allow change full URL with host, only relative path can be changed/set. Can anyone help me, how to make use of History.js and overcome cross-domain policy ? However, I can't stop using those multiple domains, so single domain is not solution. Thanks in advance for any help. That's not