history.js

How to avoid rendering the initial view of browsing session when page is refreshed from somewhere else in the application using History.js?

≡放荡痞女 提交于 2019-12-12 23:08:11
问题 I am trying very hard to implement history.js a jQuery plugin for IE 8 and 9. The demo seems to be fine in IE10+ and other modern browsers but I'm not able to understand the problem below for IE<=9. The demo is a asp.net mvc5 application where I want to provide a single page user experience where I'm just loading partial views and performing a post action via ajax. All the views load in a #shell div in my master view. May be I am missing something!! My demo app starts with http://localhost

Is it possible to use HTML5's pushState() across multiple domains?

烂漫一生 提交于 2019-12-12 09:45:25
问题 I have almost impossible problem, but I am hoping someone could come up with some working solution or workaround. I have a website where I use History.js to do on-demand page changes to prevent loading full page when clicking on links. My website however has multiple domains, so cross-domain policy doesn't allow change full URL with host, only relative path can be changed/set. Can anyone help me, how to make use of History.js and overcome cross-domain policy ? However, I can't stop using

History API html5, how to know when user clicked in next/back browser buttons? [duplicate]

▼魔方 西西 提交于 2019-12-12 08:39:36
问题 This question already has answers here : Is there a way to tell what direction the state is going with history.js? (2 answers) Closed 6 years ago . I am getting familiar with the html5 History API, but I am using history.js to extend the compatibility, I have one question and it's that, how can I know in: History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate var State = History.getState(); // Note: We are using History.getState() instead

History api statechange function script duplicates function calls each time change occurs

青春壹個敷衍的年華 提交于 2019-12-11 19:29:37
问题 I'm using the jquery history plugin in a simple demo that loads in a section of a specific page each time you click a nav item, what i've found though is that each time I click a new link the History.Adapter.bind(window, 'statechange', function() code is duplicated. Is it possible to unbind this every time the code has finished inside this function or can anyone advise where I may be going wrong with this? My test page http://kylehouston.com/_testing/history/page1.html JS navLink.on('click',

How to properly work with Router using history to pass variables?

可紊 提交于 2019-12-11 18:40:09
问题 I'm designing a website that just like facebook or anyother website that I seen I assume works (disclosure: I'm new to web programing), what I want to do is to route to different routes but in one of my routes or possibly even more I need to pass info to the next screen route when I to the new page for example: (I'm in www.website.com/page1 then move to www.website.com/page1/page2) whilst passing data through the state say I want to pass a date or a name but I would not want it to be shown in

jquery ajax $.get result doesn't find class

孤街醉人 提交于 2019-12-11 14:22:05
问题 I got stuck on a seemingly simple problem. I want to fetch the resulting HTML from a ajax request and look whether or not a specific element has a specific class and take the HTML of another element of the response and use it to replace something etc... $(function() { $('.js-nav').on('click', function(e) { e.preventDefault(); var $this = $(this); var $url = $this.attr('href'); $.get($url.url, function(response) { var $response = $(response); var $body = $response.find('.js-wrapper').html();

Problems with history.js back button

喜你入骨 提交于 2019-12-11 12:14:15
问题 I'm using history.js to update my site, which works great. It is a PHP based webshop, that, if it detects an ajax request, only serves JSON with the main div's data: if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {} On load, I ajaxify my links, an approach taken from history.js' github: https://github.com/browserstate/History.js/ function ajaxify() { var History = window.History; $('a[rel="ajax"]').click(function(e){ if

Back-Forward buttons of browser are showing weird behaviour. History.js

倖福魔咒の 提交于 2019-12-11 05:37:31
问题 I have a <select> tag. On changing the selected item, some <div> s are updated using AJAX via the functions: update_div1, update_div2, update_div3 . The code managing this operation is below and working well: $('select.select-x').change(function(e) { e.preventDefault(); var value = $('select.select-x option:selected').val(); var text = $('option:selected').text(); update_div1(value); update_div2(value); update_div3(value); manage_history(value,text); return false; }); The problem is in the

Identify whether traversing in browser history or on latest page

帅比萌擦擦* 提交于 2019-12-11 04:59:54
问题 Is there any way to identify if I have moved back to some older pages by using browser's back button or I'm standing on the latest page(on top of history stack). Using History.js, JQuery 1.7 来源: https://stackoverflow.com/questions/12146737/identify-whether-traversing-in-browser-history-or-on-latest-page

History back hook on JavaScript

依然范特西╮ 提交于 2019-12-10 14:01:08
问题 Is there a way to provide a hook such as onHistoryBack? I'm currently using history.js with History.Adapter.bind (window, 'statechange', function () {}); But I have no way to ask if user presed history.back() or if it's result of a History.pushState() call.. any idea? 回答1: The way I did this was to set a variable set to true on each click on the actual site. The statechange event would then check this variable. If it was true, they had used a link on the site. If it was false, they had