Skip to main content

How to simulate Browser back button

When someone asks how to simulate a back button, they really mean to ask how to create a link that points to the previously visited page. Most browsers tend to keep a list of which websites the user has visited and in what order they have done so.

The DOM window object provides access to the browser's history through the history object. Moving backward and forward through the user's history is done using the  back(), forward(), and go() methods of the history object.

To move backward through history, just do window.history.back(); This will act exactly like the user clicked on the Back button in their browser toolbar.

Find below a sample html code:

<html>
<head>
<script type="text/javascript">
function goBack(){
 window.history.back()
}
</script>
</head>
<body>
   <input type="button" value="Back" onclick="goBack()" />
</body>
</html>

Comments

Popular posts from this blog

Good features of Eclipse 3.6 (Eclipse Helios) JDT

Read the Eclipse Galileo features @  http://tips4ufromsony.blogspot.com/2011/10/good-features-of-eclipse35-eclipse.html New options in Open Resource dialog : The Open Resource dialog supports three new features: • Path patterns: If the pattern contains a /, the part before the last / is used to match a path in the workspace: • Relative paths: For example, "./T" matches all files starting with T in the folder of the active editor or selection: • Closer items on top: If the pattern matches many files with the same name, the files that are closer to the currently edited or selected resource are shown on top of the matching items list. MarketPlace :  Searching and adding new plugins for Eclipse have always been a challenge. The Eclipse Marketplace makes this much easier – it allows you to not only search a central location of all Eclipse plugins, but also allows you to find the most recent and the most popular plugins. Fix multiple proble...

ATG Search - how to define the search configuration rules

ATG Search configuration rules are specified through the ATG BCC Merchandising UI. Over here you could specify the below set of rules Redirection rules --> If you want to redirect to another page other than the search result page for a search keyword Property Prioritization rules  --> Prioritize certain set of properties and give weightage Result exclusion rules  --> Exclude certain search results Result positioning rules  --> Position / Sort the search result data 1.  To create the search configuration tree, you need to log-in to the ATG BCC Merchandising UI and select the Search Configuration Tree in the Browse tab drop down. Now need to click the Create button and first you need to create the Search Configuration Folder. 2.  When you create the folder, give the name of the folder and select whether the contents vary by Language or Segment. If your ecommerce site need to support more than one language and y...

How to convert your Blogger Blog to PDF ?

You can use a website called "blogbooker" @  http://www.blogbooker.com/blogger.php   to convert your Blogger Blog to a PDF . Please find the steps below : 1. Save your blog as an xml using Blogger Settings - Other - Export Blog option 2. Go to the website " http://www.blogbooker.com/blogger.php " and select this XML , give your blog address and select the options like date range, page size, font, ... 3. Click the  "Create Your BlogBook" button to view and save your blog as PDF

Google Chrome : Extensions and Applications

Following are some set of configurations that you can do after installing the Google Chrome : ------------------------------------------------------------------------------------------------------------------ To get the home button in the toolbar go to Options – Show Home button in the toolbar ------------------------------------------------------------------------------------------------------------------ World time application –> https://chrome.google.com/webstore/detail/jdhpjomiingppeefgnohkiapmnaeakoj?hl=en-US ------------------------------------------------------------------------------------------------------------------ Stop watch application –> https://chrome.google.com/webstore/detail/ggnidjbcahhbnleinchgobfnabopeioh?hl=en-US ------------------------------------------------------------------------------------------------------------------ chrome SEO extension –> https://chrome.google.com/webstore/detail/oangcciaeihlfmhppegpdceadpfaoclj ----...

ATG Search - how estore(commerce instance) forms the search engine SOAP URL ?

The comminucation between the Commerce box and the Search engine is through SOAP. Read  more about this architecture @  http://tips4ufromsony.blogspot.in/2011/11/atg-search-architectural-flow-search.html The commerce instance forms the SOAP url just like the below code: private URL getSearchEngineURL(SearchEngine engine) {       SearchEnvironmentHost h =  engine.getSearchEnvironmentHost();       SearchMachine hi = h.getSearchMachine() ;       return new URL( "http://" + hi.getHostname() + ":" + engine.getPort() + "/AEXmlService/" );   } So the commerce instance need the hi.getHostname()  and engine.getPort() to form the url. It is obtained as below: 1. The component / atg/commerce/search/refinement/ CommerceFacetSearchService has the siteName defined, which will be pointing to the environment name defined in the Search Project. Read  more about this search project setup @  http://...