browser-history

javascript history.back losses the search result

蓝咒 提交于 2019-12-22 10:16:04
问题 Page A: $(document).ready(function () { bindData(); }); function bindData() { $('#searchbtn').bind('click', function () { SearchResult(); }); } function SearchResult() { ajax call... } Page A HTML: <input type="button" id="searchbtn" /> Page B Details---> this page comes after selecting a specific search result from page A search list <a href="javascript:history.back();">Back</a><br /> Now when I go back to the Page A I can see my search criteria's as they were selected but the result Div is

Jquery: mark links as visited without opening them?

时间秒杀一切 提交于 2019-12-22 09:49:36
问题 I have no intention of just altering the link (I hear that's impossible, but if it's not I'd love to know how). I'm fine with adding it to the the browser history if that needs to be done. I'd like to loop through all <a> 's on a page and change their state to visited. For example: $("a").each(function(){ //mark as visited (somehow?) }); Essentially creating a "Mark All as Read" button on my page. Any ideas? 回答1: You could ... 1) Try using AJAX (ie. $.get(a.href)), but I don't know if that

how to catch a state change event ONCE with history.js?

我只是一个虾纸丫 提交于 2019-12-22 06:58:48
问题 I have an example code below where if you click the links, then use back and forward, each state change will cause more and more hits on the 'statechange' event. Instead of the one that I expect. Links: https://github.com/browserstate/history.js http://docs.jquery.com/Downloading_jQuery Code: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>History start</title> </head> <body> <h1>Headline</h1> <hr> <div id="menu"> <ul> <li> <a href=

HTML5 push/replaceState and the <base> tag causes security exception

房东的猫 提交于 2019-12-22 04:25:09
问题 I have a test version of a site located at a subdomain of the normal site, like: http://test.x.com instead of http://x.com. I use the <base> tag to translate all resource requests back to the original domain: <base href="http://x.com/" /> This tactic worked great until I implemented HTML5 push/replaceState support. Now, if I execute this statement in the console: history.pushState({}, "", ""); ... then I get a DOMException object in WebKit-based browsers: code: 18 constructor:

HTML5 reload page when moving back

时光毁灭记忆、已成空白 提交于 2019-12-22 00:56:22
问题 I'm working with Moodle 2.6, but this isn't really a Moodle question. An activity is defined as an URL. That URL is just a custom-built video player. When the video ends, it goes back to the Moodle course page. That all works just fine, but the Moodle page doesn't reflect that this activity has been completed until the page is refreshed/reloaded using F5. Here is the javascript code that I've used to detect the end of the video: video1.addEventListener("ended", function() { history.back(1); }

How To Prevent Iframe Pages Being Inserted Into IE Browsing History

左心房为你撑大大i 提交于 2019-12-21 20:46:50
问题 I'm having a lot of trouble with iframe pages being inserted into the browsing history of IE9. It's a pain because you have to click back several times in order to get to the previous page. What is the cause of this? Is it a bug in the browser or the page? Edit: I realized I was using javascript to update the source of all iframes on the page to add the wmode=transparent attribute. $('iframe').each(function () { var url = $(this).attr("src") $(this).attr("src", url + "?wmode=transparent"); })

How to get browsing history using history API in Chrome extension

人盡茶涼 提交于 2019-12-21 12:35:49
问题 How can I get the URLs of recently visited tabs using chrome.history API, specifically, the last 10 URLs visited? 回答1: Pass an empty string as your query to the search() method of the chrome.history API. For example, this will log the 10 most recently visited URLs to the console: chrome.history.search({text: '', maxResults: 10}, function(data) { data.forEach(function(page) { console.log(page.url); }); }); 来源: https://stackoverflow.com/questions/24894627/how-to-get-browsing-history-using

Clear Android Browser History

孤街醉人 提交于 2019-12-21 02:58:09
问题 I am writing an application for a client that will have several devices that are open to customers to look at and play with. They want to be able to clear the browser history on a regular basis so that if a customer opens the browser to an inappropriate web site the next customer to come along will not see this. I am currently using this to clear the history and searches: Browser.clearHistory(getContentResolver()); Browser.clearSearches(getContentResolver()); This correctly clears the history

accessing history in a firefox addon

。_饼干妹妹 提交于 2019-12-21 02:41:49
问题 I'm working on a firefox addon, using the addon builder. I want to periodically scan the browser's history.. the entire history. I'm looking for functionality like chrome's history api. It seems window.history is limited to session history only. Any help? I'm going crazy trying to figure this out. Addons like history export must do something like this, but their code is not immediately understandable to me. 回答1: You'll need to access the xpcom service nsIBrowserHistory, here's some example

Can I update window.location.hash without having the web page scroll?

柔情痞子 提交于 2019-12-20 16:31:13
问题 Using JavaScript, is there a way to update window.location.hash without scrolling the web page? I have clickable title elements that toggle the visibility of a div directly beneath them. I want the /foo#bar in the history when clicking titles but don't want the page scrolling about. So when navigating away from /foo#bar I'll be able to use the back button and have the div whose ID is in window.location.hash be visible upon return. Is this behavior possible? 回答1: This behavior is very much