pushstate

Backbone.js PushStates: Fallback for Internet Explorer not working

↘锁芯ラ 提交于 2019-11-30 09:52:02
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 , but also includes details for item id 1234 . Backbone.js Router // Router var AppRouter = Backbone

HTML: Changing the URL without reloading the page?

时间秒杀一切 提交于 2019-11-30 09:04:37
问题 Check out this link: http://google.blogspot.com/view/timeslide And click on the post and as you can see the URL is changing but without a # or something like that, It changes like the page would load normally, but the content changes just like it would be built with AJAX. This happens with Chrome 10 with the latest stable version, but for Firefox 3.6 it uses the old way with the hash :) How is this possible, is this a new HTML5 feature or what? 回答1: pushState: window . history . pushState

CodeIgniter + jQuery(ajax) + HTML5 pushstate: How can I make a clean navigation with real URLs?

怎甘沉沦 提交于 2019-11-30 07:19:07
I'm currently trying to build a new website, nothing special, nice and small, but I'm stuck at the very beginning. My problems are clean URLs and page navigation. I want to do it "the right way". What I would like to have: I use CodeIgniter to get clean URLs like "www.example.com/hello/world" jQuery helps me using ajax, so I can .load() additional content Now I want to use HTML5 features like pushstate to get rid of the # in the URL It should be possible to go back and forth without a page refresh but the page will still display the right content according to the current URL. It should also be

Chrome onpopstate / pushState bug?

纵饮孤独 提交于 2019-11-30 03:56:55
问题 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

Appending parameter to URL without refresh

若如初见. 提交于 2019-11-30 00:05:04
I know this has been asked many times before but answers were not descriptive enough to solve my problem. I don't want to change the whole URL of page. I want to append a parameter &item=brand on button click without refresh. Using document.location.search += '&item=brand'; makes the page refresh. Using window.location.hash = "&item=brand"; append without refresh but with a hash # which eliminates the usage/effect of the parameter. I tried to remove the hash after appending but that didn't work. This answer and many others suggest the use of HTML5 History API, specifically the history

window.history.pushState not going back in history

落爺英雄遲暮 提交于 2019-11-29 22:45:01
问题 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

How does Facebook show browser loading progress during AJAX Page Loads?

99封情书 提交于 2019-11-29 22:17:37
In order to keep the IM Client logged in at all times Facebook avoids full page loads by using AJAX to load its pages before inserting them into the document. However, during Facebook AJAX requests the browser appears to be visibly loading; the reload button changes to an X, and the progress indicator built into the browser indicates loading/waiting etc) I've been able to implement AJAX based navigation successfully, but my browser doesn't show any indication of loading (since the requests are asynchronous) how do Facebook do it? Jeremy Banks The browser displays the loading state when there

How Does Github Do pushState Without Hash Tags?

混江龙づ霸主 提交于 2019-11-29 21:58:34
I've been researching the best way to utilize HTML5's history api aka psuhState with a proper fallback for HTML4 browsers. Github uses the history api for its tree browsing (the following link is just an example, not the library github uses): https://github.com/browserstate/History.js/ What I can't figure out is how they handle this functionality for HTML4 browsers such as Firefox 3.5? I've looked at, specifically, history.js (linked above) to handle this sort of thing. But it requires a hash # implementation for HTML4 browsers which I'd like to avoid. If you visit Github and browse a

Account for Backbone.js pushState routes with node.js express server?

谁都会走 提交于 2019-11-29 20:01:50
pushState support was introduced with Backbone.js' version 0.5 update. From the backbone documentation : Note that using real URLs requires your web server to be able to correctly render those pages, so back-end changes are required as well. For example, if you have a route of /documents/100, your web server must be able to serve that page, if the browser visits that URL directly. For full search-engine crawlability, it's best to have the server generate the complete HTML for the page ... but if it's a web application, just rendering the same content you would have for the root URL, and

Backbone.js PushState True

▼魔方 西西 提交于 2019-11-29 16:00:36
I've created a site in backbone and for various reasons I've decided I want to remove the hash in the URL. I've changed history.start from Backbone.history.start(); to Backbone.history.start({pushState: true, root: '/'}); but once I do that the routing stops working correctly. My routing looks like this: var Router = Backbone.Router.extend({ routes: { "": "home", "home": "home", "artists": "artists", } }); var router = new Router; router.on('route:home', function() { console.log("home"); // Code }); router.on('route:artists', function() { console.log("artists"); // Code }); //Backbone.history