browser-history

Popstate - passing popped state to event handler

偶尔善良 提交于 2019-11-29 18:30:04
问题 The following code should cause an alert of '1', but instead does nothing. window.onpopstate = function(event) { alert(event.state.a) } history.pushState({a: 1}) history.back() Fiddle: http://jsfiddle.net/WNurW/2/ Any ideas? 回答1: Your code woudn't cause a popstate, as the pushstate command tells what page you are on NOW. window.onpopstate = function(event) { alert(event.state.a) } history.pushState({a: 1}); history.pushState({a: 2}); history.back() The above code will work. Heres the fiddle:

How to clear browsing history using WebBrowser control in C#

痴心易碎 提交于 2019-11-29 18:20:44
I want to clear the browsing history of a WebBrowser control in C# after the WebBrowser completes its browsing. This is my code: try { foreach (string sr in File.ReadAllLines("link.txt")) { webBrowser1.Navigate(sr); webBrowser1.ScriptErrorsSuppressed = true; } while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } } catch(Exception) { MessageBox.Show("Internet Connection not found","Error",MessageBoxButtons.OK,MessageBoxIcon.Error); this.Close(); } Temporary Internet Files System.Diagnostics.Process.Start("rundll32.exe", "InetCpl.cpl,ClearMyTracksByProcess

Reading window.history.state object in Webkit

余生颓废 提交于 2019-11-29 15:42:58
Safari and Chrome (and, I'm guessing, all Webkit browsers) do not respond to window.history.state which is specified in the evolving HTML5 standard here and is implemented in Firefox. Is there a workaround to read it? Perhaps it is possible to trigger a popstate event in code and return the state from the event handler? kubetz window.history.state is not implemented in webkit broswers currently. There is a request for it, but no steps towards implementation were done so far. There is a project called history.js which is aiming to provide cross-compatible history management experience. History

how to get browser history in android?

心不动则不痛 提交于 2019-11-29 14:30:42
问题 I would like to implement an application to get android default browser history and saving the browser history to an xml file.But the browser history is not saving in some devices into an xml file. I have implemented my application for get the browser history info to save to xml file as follows: private void browserHistoryDOM() { try{ File newxmlfile = new File("/sdcard/Xmlfiles/briwserHistory.xml"); newxmlfile.createNewFile(); DocumentBuilderFactory documentBuilderFactory =

Change browser back button behaviour for my web app?

爱⌒轻易说出口 提交于 2019-11-29 13:57:06
Im making an 'app like' web page. The actual page is wider than the browser viewport which has its overflow hidden. Clicking different links changes the CSS to animate to different sections. Here is a very simple demo: http://smartpeopletalkfast.co.uk/pos/ At this stage im working on a demo, not a production site. I want to intercept the browser back button, so if you've navigated to a section, you would be taken back to the previous section rather than leaving the web page. In a perfect world this would happen with the same animations ive used for navigating to sections. Can this be achieved?

history.go('url') issue

血红的双手。 提交于 2019-11-29 11:39:24
I've seen that history.go() method can have two types of parameter: see: http://www.w3schools.com/jsref/met_his_go.asp But url does not working at all. I use JavaScript console of browser to test this method but got no success. I know that there are security issues, that you can't read history entries. You can just go back and forward. So why this string parameter listed in all js references? Supplying a URL as a parameter is a non-standard feature and will not work in all browsers. Most browsers accept only a relative number, e.g. 1 or -1 . From the MDC documentation (emphasis mine): [

Managing Browser History in Ajax

巧了我就是萌 提交于 2019-11-29 08:49:18
I am using ajax in my site. If a user enters a query and select a category, i will updates the page with result with ajax. I also update the url with hash value which shows query and category seperated by an & . What I want is that when the browser back button is pressed I want to display the previous result without reloading. What i am getting is that the URL has the previous values, but the result is not updating. You can use : " Yahoo! UI Library: Browser History Manager " 来源: https://stackoverflow.com/questions/974186/managing-browser-history-in-ajax

How do I determine whether I am going “forward” or “backward” through my History in GWT?

醉酒当歌 提交于 2019-11-29 07:44:26
I am looking at History and History JavaDocs in GWT and I notice that there is no way to tell whether the forward or backward button was pressed (either pragmatically or by the user). The "button press" is handled by your registered addValueChangeHandler, but the only thing passed to the handler is a string on your history stack. There is no indication as to whether the "History" is moving "back" (using the back arrow button) or "forward" (using the right arrow button). Is there any way to determine this? Sorry, you can't. And even if you could, there are browsers, like Firefox, that let the

browser back and forward button does not invoke callback method with statechange event of history.js

拟墨画扇 提交于 2019-11-29 07:39:41
I used ( https://github.com/browserstate/history.js ) and have a piece of code like this History.Adapter.bind(window, 'statechange', function() { var State = History.getState(); alert('Inside History.Adapter.bind: ' + State.data.myData); }); function manageHistory(url, data, uniqueId){ var History = window.History; if ( !History.enabled ) { return false; } History.replaceState({myData: data}, null, '?stateHistory=' + uniqueId); } if I invoke manageHistory() after my ajax call, then History.Adapter.bind callback method get invoked correctly. However, if I click the browser back and then click

history.back(); doesn't trigger $(document).ready();

可紊 提交于 2019-11-29 05:39:04
I have a webpage that use $(document).ready() to build the interface. Then the user can go to a child page, and to go back to the original page he can press the browser's "previous" button or a "Return" button in the page which triggers a history.back(); . Back on the original page, $(document).ready() is not triggered so the page is missing informations. is there a way to trigger it automatically like if it was a "real load"? thank you! edit placing an alert in it, the alert is poped but stuff is missing in my interface like if some part of the ready event is missing. Investigating... edit 2