pushstate

pushState with Rails ajax

风格不统一 提交于 2019-12-01 05:57:25
I have an index action page showing a list of items with are paginated with Kaminari and I have added ajax functionality to them and now am trying to get the URL to fit in by using pushState. My question is how do I get the URL to pass to the pushState method when my pagination links are done via: <%= paginate @coasters, remote: true %> and the javascript view is as follows: $('.grid').html('<%= escape_javascript render(@coasters) %>'); $('.pagination').html('<%= escape_javascript(paginate(@coasters, remote: true).to_s) %>'); I need to somehow get the URL to pass as the 3rd argument of

IE history push state

半城伤御伤魂 提交于 2019-12-01 05:46:32
I have a webpage where the user has the possibility to display the terms and conditions without reloading the page, via AJAX. That, in itself, is no problem, however, I am also trying to push a history state. That works fine in most browsers, except in IE. For some inexplicable reason, there, the content is loaded via AJAX, but also, a new tab is opened with the previous page. How can I fix this? You can see the example on this webpage ( http://galaxy-battle.de ), try clicking on "T&Cs" in the "Join"-box. Sergei Grebnov IE9 and below doesn't support pushState . You have an exception when

IE history push state

笑着哭i 提交于 2019-12-01 03:15:55
问题 I have a webpage where the user has the possibility to display the terms and conditions without reloading the page, via AJAX. That, in itself, is no problem, however, I am also trying to push a history state. That works fine in most browsers, except in IE. For some inexplicable reason, there, the content is loaded via AJAX, but also, a new tab is opened with the previous page. How can I fix this? You can see the example on this webpage ( http://galaxy-battle.de ), try clicking on "T&Cs" in

HTML5 History API back button with partial page loads

*爱你&永不变心* 提交于 2019-12-01 03:14:51
To improve the performance/responsiveness of my website I have implemented a partial page load using AJAX, replaceState, pushState, and a popstate listener. I essentially store the central part of my page (HTML) as my state object in the history. When a link is clicked I request just the central bit of the page from the server (identifying these requests with a different Accept header) and replace it with javascript. On popstate I grab the previous central part and push it back into the dom. This mostly works fine, however I have found a particular issue which I am stuck on. It is a little

HTML5 History API back button with partial page loads

让人想犯罪 __ 提交于 2019-12-01 00:17:25
问题 To improve the performance/responsiveness of my website I have implemented a partial page load using AJAX, replaceState, pushState, and a popstate listener. I essentially store the central part of my page (HTML) as my state object in the history. When a link is clicked I request just the central bit of the page from the server (identifying these requests with a different Accept header) and replace it with javascript. On popstate I grab the previous central part and push it back into the dom.

Chrome onpopstate / pushState bug?

China☆狼群 提交于 2019-11-30 20:14:30
First of all I'm not entirely sure what I'm doing or expecting is right. There doesn't seem to be much documentation about this, but what I've read suggests that this should work. I encountered some problems while trying to use history.pushState so I ended up making a demo page to see what was going wrong. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" ></script> <script> window.onpopstate = function() { var d

How does pushState protect against potential content forgeries?

痞子三分冷 提交于 2019-11-30 18:01:37
As seen in GitHub's blog , they've implemented HTML5's JavaScript pushState feature for tree browsing (for modern browsers), bringing AJAX navigation without Hash Bangs . The code is simple: $('#slider a').click(function() { history.pushState({ path: this.path }, '', this.href) $.get(this.href, function(data) { $('#slider').slideTo(data) }) return false }) This quite elegantly allows them to: Request the just the new content through AJAX instead of a full page Animate the transition And change the browsers URL (not just the # , as Twitter does — twitter.com/stackexchange → twitter.com/#!

How does pushState protect against potential content forgeries?

放肆的年华 提交于 2019-11-30 16:43:14
问题 As seen in GitHub's blog, they've implemented HTML5's JavaScript pushState feature for tree browsing (for modern browsers), bringing AJAX navigation without Hash Bangs. The code is simple: $('#slider a').click(function() { history.pushState({ path: this.path }, '', this.href) $.get(this.href, function(data) { $('#slider').slideTo(data) }) return false }) This quite elegantly allows them to: Request the just the new content through AJAX instead of a full page Animate the transition And change

window.history.pushState not going back in history

∥☆過路亽.° 提交于 2019-11-30 16:09:34
I have a little problem experimenting with the history.pushstate event. I set it up so that the url of the page would be the actual URL of the page loaded via AJAX and that works just fine. I understood that it should automaticaly create a history, loading the pages previously loaded. unfortunatly hat doesn't happen and when i click back of forward the url does change but not the page. Can you help me? Here is my simplified code: function hijackLinks() { $('a').live("click", function (e) { e.preventDefault(); loadPage(e.target.href); direction = $(this).attr('class'); }); } function loadPage

Page not reloading via 'back' when using pushState() / onpopstate

。_饼干妹妹 提交于 2019-11-30 11:16:12
I am refreshing some pages with AJAX and so an updating the history with the following code - /** Update the page history */ var pushState_object = { ajax_string: ajax_string, security: security, }; window.history.pushState(pushState_object, title, permalink); I am then calling this onPopState function on page load - window.onpopstate = function(e){ if(window.history.state !== null){ initiate_load_updated_page(window.history.state.ajax_string, window.history.state.security, 0) } } I am having a slight problem though using the back button when going from a page where the content was generated