history.js

History.pushState(data,title,url) concatenates (instead of replacing) url to address bar if there is a trailing slash

旧城冷巷雨未停 提交于 2021-02-07 05:46:20
问题 For example, If I use the search bar from "www.site.com" I see "www.site.com/search", which is fine. If I use the search bar from "www.site.com/events/" I see "www.site.com/events/search", which is silly. Why does it do this? Is this the behavior or a history.js bug or my bug? 回答1: Give an example of what you are doing. If your current URL in the address bar has the form: http://somesite.com/path/ And you pass pushState( null, null, 'newpath' ); in this case, the link will look like http:/

Duplicate History enteries using History.pushState in Chrome/Safari

安稳与你 提交于 2020-06-10 04:58:12
问题 I am having a strange problem in Chrome and Safari using History.js from https://github.com/browserstate/history.js/ If I click on several different ".node" items and then look at my browsers history, I have duplicate entries for each click and need to his the back button twice to go back the the last "real" state. I added a console.log(id) in and can confirm that the event is only firing the one time. In Firefox it works as expected. I am only seeing the duplicate history items in Chrome and

rails ajax_pagination couldn't find file 'history'

杀马特。学长 韩版系。学妹 提交于 2020-01-02 07:47:33
问题 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!

History.js for HTML5 - Hack Needed to Not Break IE7

∥☆過路亽.° 提交于 2019-12-31 03:20:07
问题 My goal is to support AJAX history for HTML5 browsers only. However, I would like my site to work with HTML4 browsers, but without AJAX history. Many of the History.js examples include the following check before performing any operations: if (!History.enabled) { // History.js is disabled for this browser. // This is because we can optionally choose to support HTML4 browsers or not. return false; } This would seem to work except for the fact that older browser such as IE7 do not support native

jquery.history.js VS jquery-hashchange

会有一股神秘感。 提交于 2019-12-29 18:43:12
问题 See http://balupton.github.io/jquery-history/demo/ I was attracted with jquery.history.js mean while I found http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/ I think the second one is just based on JQuery. I mean it don't need any additional plugin than jQuery. What is special in jquery.history.js? than hash change?. Which should I use to override my browsers back and forward buttons ? 回答1: EDIT - Late 2013 Another hash library called "sammy.js" is popular as well

jquery plugin history.js not working properly in html4 browsers

让人想犯罪 __ 提交于 2019-12-24 16:53:31
问题 From my homepage, let's call it mysite.com , I click a link which has this href value: /home/home.php?doc=gym . So, the entire url is mysite.com/home/home.php?doc=gym# (The browser adds the # at the end of the url, but I need that to be before the parameters in order the plugin works fine). From that page, home.php , I clicked a link that I caught its event, load some Ajax data and want to change the url mysite.com/home/home.php?doc=gym to mysite.com/home/home.php?doc=pilates . So, what I do

javascript redirect with hash tag

蹲街弑〆低调 提交于 2019-12-24 16:19:26
问题 I have implemented my website's search results with AJAX, using History.js. For HTML5 browsers, I have URLs like http://example.com/search/X6a2/3 , which, in browsers not supporting the History API, does fall back nicely to http://example.com/search/#X6a2/3 . However, if a HTML5 URL is opened in an older browser, the new hash tag is appended to the full URL as soon as the page is changed. (for example http://example.com/search/X6a2/3#/X6a2/4 - ugh!) All I need is a clean way to redirect to

Force html4 fallback in history.js

拥有回忆 提交于 2019-12-23 09:37:44
问题 I can not get the html4Mode option to work for me. I am using the ajaxify script (https://github.com/browserstate/ajaxify) on a very simple two page app. Everything works fine in html5 capable browsers, but if I want to force the html4 fallback for testing purposes nothing changes, it seems history ignores the options and continues to use html5 push state urls. To force the fallback I just changed the ajaxify script adding (on DOM ready): History.options.html4Mode = true; (I am using the v1

how to catch a state change event ONCE with history.js?

我只是一个虾纸丫 提交于 2019-12-22 06:58:48
问题 I have an example code below where if you click the links, then use back and forward, each state change will cause more and more hits on the 'statechange' event. Instead of the one that I expect. Links: https://github.com/browserstate/history.js http://docs.jquery.com/Downloading_jQuery Code: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>History start</title> </head> <body> <h1>Headline</h1> <hr> <div id="menu"> <ul> <li> <a href=