pushstate

Update browser's URL without reloading the page

…衆ロ難τιáo~ 提交于 2019-12-04 08:35:08
问题 Is it possible to change the URL shown in the browser's address bar without having the browser go to that page? Such as, for example, after updating a page's content via an AJAX call? My understanding is that this is not possible, which is why sites such as twitter and facebook update the hash-tag on ajax calls. That is until today, when I went on http://8tracks.com/ and started to play with the filter on the right hand side... turning different genres on and off, I noticed that even though

back button in browser not working properly after using pushState (in Chrome)

只谈情不闲聊 提交于 2019-12-04 08:28:35
问题 I am using this type of line in an JS response if (history && history.pushState){ history.pushState(null, null, '<%=j home_path %>'); } but when I click back in the browser, I see the JS code of the response instead of the previous page. Is there a way to make the back button work so it would re-request the page of the last url (before home_path as pushStated in? Update : I've found this.. it seems other have the same issue with.. History.js doesn't fix it either So to confirm some of the

AngularJS: Relative link paths are broken when html5mode(true) is on

可紊 提交于 2019-12-04 08:10:44
I've been searching and I've found "solutions" to this problem, yet I still can't get this to work right. The Scenario: I'm building an Angular (version 1.2) website with the UI Router and running it on a Node server on localhost. I'm trying to make it have "pretty" url's with the $locationProvider and by turning html5(true) on. My website works fine when clicking through it, but when I try to navigate to a relative link path or refresh the link path the page breaks. I also intend to deploy this webapp to Heroku when completed: RELATIVE LINK PATH: http://localhost:8000/locksmith-services PAGE

history.pushState in Chrome make favicon request

妖精的绣舞 提交于 2019-12-04 01:27:01
code : var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname +"?"+ queryStr; window.history.pushState({path:newurl},'',newurl) current scenario : everytime when window.history.pushState() is invoked favicon requests occur rapidly.It makes network request for favicon on every call of this function. expected scenario : favicon should be loaded only once on page load, I would not expect the favicon load on every request of window.history.pushState() . favicon paths are link like this in HTML page : <!-- Favicon --> <link rel="icon" type="image/png" href=".

history pushState and scroll position

大憨熊 提交于 2019-12-03 23:23:25
I am trying to retrieve the scroll position when a user navigates back in the browser history using HTML5 popstate handler. Here is what I have: $(document).ready(function () { $(window).on('popstate', PopStateHandler); $('#link').click(function (e) { var stateData = { path: window.location.href, scrollTop: $(window).scrollTop() }; window.history.pushState(stateData, 'title', 'page2.html'); e.preventDefault(); }); }); function PopStateHandler(e) { alert('pop state fired'); var stateData = e.originalEvent.state; if (stateData) { //Get values: alert('path: ' + stateData.path); alert('scrollTop:

Backbone.js PushStates: Fallback for Internet Explorer not working

情到浓时终转凉″ 提交于 2019-12-03 19:36:36
问题 My site has just implemented pushstates in Backbone.js and the entire site breaks for IE. How should I create a fallback for IE? What I am trying to achieve Main URL: http://mydomain.com/explore Another URL: 'http://mydomain.com/explore/1234 The main page of the site is http://mydomain.com/explore which triggers the router function explore . When a user visits http://mydomain.com/explore/1234 , Backbone's router will trigger the function viewListing , which is the same as function explore ,

preserving browser “back” button functionality using AJAX/jQuery to load pages and history.pushState() method

给你一囗甜甜゛ 提交于 2019-12-03 09:15:09
问题 I'd like to preserve the back button functionality when loading pages via AJAX (jQuery load method) and pushing the URL to the browser bar via the history.pushState method. The problem occurs when one clicks on the browser back button and the 1st click only restores the previous URL but does not load the previous page. Here's my code so far: $(function(){ var profile_url= "/profile"; $('#click_button').click(function(){ $('#main_content').load(profile_url); history.pushState({profile:profile

Backbone.js routing without changing url

你说的曾经没有我的故事 提交于 2019-12-03 09:06:54
问题 I am migrating a single-page web application based on Backbone.js and jQuery to a Chrome extension. However, neither the pushState nor the hashbang-based router modes seem to play well with the environment within the extension. I've come to the conclusion that I'm better off just directly rendering views on user interactions, bypassing the window.location system altogether. However, I'm not too sure how to implement this without changing calls to Router.navigate in dozens of files. Is there a

history.pushState - not working?

拈花ヽ惹草 提交于 2019-12-03 08:50:59
问题 I want to change html without reload. I do it like: $('#left_menu_item').click(function(e) { if (!!(window.history && history.pushState)) { e.preventDefault(); history.pushState(null, null, newUrl); } }); It works correctly. But if I want to go back with "Back" button - browser change url on previous, but it not reload page. Why? 回答1: this behaviour is expected and is in accordance with the specifications of manipulating the history stack. this is a relatively complex problem to explain. but

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