pushstate

httpd.conf and HTML5 pushstate()

落花浮王杯 提交于 2019-11-28 02:01:41
I'm running an AJAX enabled site that caters for HTML4 hash and HTML5 pushstate(). I've just migrated to an AWS EC2 instance (linux server running apache) and both site are running fine. The only issue I've experienced is when I refresh a HTML4 hash page the correct page shows. However when I refresh a HTML5 page like http://www.datingjapan.co/conversations I get the following error message: It appears that apache is trying to go into the folder 'converstations' rather then just call the site 'index.php' which then using jquery to load the correct page. Can anyone advise what might be the

Using history.pushstate in IE9

99封情书 提交于 2019-11-27 23:08:38
问题 Since window.history.pushState is not aviliable for HTML 4 browsers like IE9 , I have looked for history.js, a jQuery library that simulates the pushState behavior. The problem is , when using pushState, the end of the url is duplicated For example, History.pushState(null,null,window.location.pathname + '?page=1'); returns, http://www.development.com/test.html#test.html?page=1 How do I avoid this problem? Thank you kindly. Update (On 2012 / 1 /22) , Question for bounty: if (pageNo == 1){ /

How to cope with refreshing page with JS History API pushState

烂漫一生 提交于 2019-11-27 21:14:15
A small website I was creating (more like fiddling) uses AJAX to load each page. Previously I was changing the hash of the url, this worked great but was ugly, and the user could refresh the page, and it would stay on the same page. Now I have switched to using pushState in the JS History API, which looks much better, and the back and forward work, but refreshing does not. For example: Going to: http://example.com/page2 goes to a 404 as there is no real page called page 2. But if I click on the button which uses the pushState method to change the url, it works as it should. How can allow

Appending parameter to URL without refresh

社会主义新天地 提交于 2019-11-27 20:20:02
问题 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

Rewriting nginx for pushState-URL's

旧时模样 提交于 2019-11-27 17:28:04
I am trying to get nginx to work with my pushState -based URI handling that backbone.js manages for me in an Javascript app. Right now accessing URI's with one level, eg. example.com/users works well, but not two-level or deeper URI's, such as example.com/users/all , which is mentioned in the Backbone documentation : 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 So, being far from acquainted with nginx's rewrite options, I am still sure that I can do something like rewrite ^ /index.html; to redirect

pushState: what exactly is the state object for?

穿精又带淫゛_ 提交于 2019-11-27 09:46:04
问题 I've read a dozen of times now that the state object could exists of multiple key|value pairs and that it is associated with the new history entry. But could someone please give me an example of the benefits of the state object? Whats the practical use of it? I can't imagine why not just typing in {} 回答1: Take this small example: run fiddle (editor view): You have a page where a user can select a color. Every time they do, we generate a new history entry: function doPushState(color) { var

How to handle back button while changing the browser-URL with HTML5 pushState

≯℡__Kan透↙ 提交于 2019-11-27 07:14:54
问题 I’ve made a one page site. When user clicks on the menu buttons, content is loaded with ajax. It works fine. In order to improve SEO and to allow user to copy / past URL of different content, i use function show_content() { // change URL in browser bar) window.history.pushState("", "Content", "/content.php"); // ajax $content.load("ajax/content.php?id="+id); } It works fine. URL changes and the browser doesn’t reload the page However, when user clicks on back button in browser, the url

popstate returns event.state is undefined

久未见 提交于 2019-11-27 06:34:59
问题 I am learning about history in HTML5, in this example (open the JavaScript browser console to see error) the event.state.url returns: Uncaught TypeError: Cannot read property 'url' of undefined Look and help: http://jsfiddle.net/un4Xk/ 回答1: event is the jQuery event object, not the DOM one. To access the DOM event object, use event.originalEvent : http://jsfiddle.net/pimvdb/un4Xk/1/. var state = event.originalEvent.state; Remember that the state is only defined when the new state has data, so

history.pushState() change query values

左心房为你撑大大i 提交于 2019-11-27 06:06:39
问题 If I have a link that is being changed with the function history.pushState({}, "", link); where my link is for example page.php?value=1&value2=2 Is there a way to just change the value2 with pushState() function instead of changing the whole link? 回答1: If what you're trying to do is change the URL without adding an additional entry to the history object, you might try replaceState . history.replaceState({value: 1, value2: X}, "title", "page.php"); 回答2: No, because the query string is part of

pushState and SEO

蓝咒 提交于 2019-11-27 05:53:05
Many people have been saying, use pushState rather than hashbang. What I don't understand is, how would you be search-engine friendly without using hashbang? Presumably your pushState content is generated by client-side JavaScript code. The scenario is thusly: I'm on example.com . My user clicks a link: href="example.com/blog" pushState captures the click, updates the URL, grabs a JSON file from somewhere, and creates the listing of blog posts in the content area. With hashbangs, google knows to go to the escaped_fragment URL to get their static content. With pushState, Google just sees