pushstate

Push state enabled & context path routing: Static assets are not found on the server

戏子无情 提交于 2021-01-27 13:55:22
问题 I deployed a react app to cloud foundry by using the static buildpack. The goal is making the app accessible under domain.com/ path . So I configured the route accordingly to his blog post: https://www.cloudfoundry.org/context-path-routing/ Also, I set pushstate: enabled in the static file and added the context path to the static asset URLS; E.g. The URL for the style sheet is domain.com/path/static/style.css . When I visit domain.com/path I get the index.html file. However the static assets

Forward button not working after history.pushState

安稳与你 提交于 2020-03-01 12:09:51
问题 I've found how to fix the back button, but the forward button has remained unfix-able. The url will change but the page doesn't reload, this is what I'm using: $('.anchor .wrapper').css({ 'position': 'relative' }); $('.slanted').css({ 'top': 0 }); // Do something after 1 second $('.original-page').html(''); var href = '/mission.html' console.log(href); // $('#content-div').html(''); $('#content-div').load(href + ' #content-div'); $('html').scrollTop(0); // loads content into a div with the ID

What are possible cases making window.history.state null on browser back?

佐手、 提交于 2020-01-13 20:41:55
问题 I have my website's query string URL like: ?budget=0-&year=0-&kms=0-&so=-1&sc=-1&pn=1 When user go to next page (From page 1 to page 2): We explicity increment pn (page number by 1) and set it in query string URL. Changed query string: ?budget=0-&year=0-&kms=0-&so=-1&sc=-1&pn=2 I also store the old query string, it looks like: ?budget=0-&year=0-&kms=0-&so=-1&sc=-1&pn=1 I then push both to window history to change URL and save previous for browser back: window.history.pushState(oldQS, null,

HTML5 History API - What is the max size the state object can be?

北城以北 提交于 2020-01-12 01:43:27
问题 The pushState method accepts a state object. Firefox documents say the maximum size of this object is 640kb. Is it defined in the specs what the smallest maximum size a browser can implement is? Can I reasonably expect major browsers to provide me with at least 100kb? EDIT: I tested it out with Chrome, and it was still working for state objects over 1MB. 回答1: No. The normative document here is http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#dom-history-pushstate and

Is there any way to programmatically call and execute pjax from within my javascript file?

和自甴很熟 提交于 2020-01-03 15:55:33
问题 I have a function that waits for a user to click on an input of type text and then waits for the user to press the down and up arrow keys. When the user presses the down and up arrow keys the function hoverDown() is called which essentially programmatically hovers over tables rows. When enter is pressed, window.location is called and the appropriate page is loaded. The problem is that I'm using pjax throughout my application to dynamically load the content and push the new url without a page

Append parameter in url without reloading page

我的梦境 提交于 2019-12-31 03:54:35
问题 I am using following code to append param to url. This is working fine but when parameter is appended in url, page is getting reloaded. I want to use this functionality without reloading the page . function insertParam(key, value) { key = escape(key); value = escape(value); var kvp = document.location.search.substr(1).split('&'); var i=kvp.length; var x; while(i--) { x = kvp[i].split('='); if (x[0]==key) { x[1] = value; kvp[i] = x.join('='); alert('sdfadsf'); break; } } if(i<0) {kvp[kvp

pushState change - equivalent to Chrome Extension onHistoryStateUpdated

戏子无情 提交于 2019-12-30 12:22:13
问题 I'm porting a Chrome extension to a Firefox extension and due to the nature of the website that it runs on, I need to monitor the pushState . Chrome Extensions has a handy way to handle this: chrome.webNavigation.onHistoryStateUpdated . The way that I use it in the Chrome extension is as follows: chrome.webNavigation.onHistoryStateUpdated.addListener(function(details) { var tabUrl = details.url; if (isTabUrlValid(tabUrl)) { $.get(tabUrl, function(data) { var videoUrl = $(data).find('meta

pushState with Rails ajax

不羁岁月 提交于 2019-12-30 09:40:11
问题 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(

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

走远了吗. 提交于 2019-12-30 02:17: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

How to get notified about changes of the history via history.pushState?

拟墨画扇 提交于 2019-12-27 10:19:52
问题 So now that HTML5 introduces history.pushState to change the browsers history, websites start using this in combination with Ajax instead of changing the fragment identifier of the URL. Sadly that means that those calls cannot be detect anymore by onhashchange . My question is: Is there a reliable way (hack? ;)) to detect when a website uses history.pushState ? The specification does not state anything about events that are raised (at least I couldn't find anything). I tried to create a