Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

back button

Posted on 2011-03-09
6
435 Views
Last Modified: 2012-05-11
In the content <div> I have a jsp . it has a back button . When user clicks on it, it should show the previous page in the content <div>.

Whats the approach ?
0
Comment
Question by:cofactor
  • 3
  • 2
6 Comments
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 35092411
use window.history.forward() to go back the prvious page ?
0
 

Author Comment

by:cofactor
ID: 35092652
>>>use window.history.forward() to go back the prvious page ?

I want the previous page so back() is appropriate I think.

I tried  onclick="history.back();"   in the button ..but that does not work ...it throws the  login page.

But I want the previous page in the content <div>.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 35094712
Not possible with javascript. You may save the previous page with an unique id in a table (I mean save value of fields of that page) and when the user click on the div, rebuild the page with the fields and their saved value
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 82

Expert Comment

by:leakim971
ID: 35094757
you can load content of a page and put it easily in a div (or any other container) with jQuery and the function : http://api.jquery.com/load/

backupId = $("#backup").val();
$("#divId").load("previouspage.jsp?backupId=" + backupId + " body");

Open in new window

with

<input type="hidden" id="backupId" value="12345" />
<div id="divId"><!-- put previous page content(body) here --></div>

Open in new window

0
 

Accepted Solution

by:
cofactor earned 0 total points
ID: 35213804
I have used session. I have kept all the data in session . when the user clicks back . I have revult the page fetching data from session.
0
 

Author Closing Comment

by:cofactor
ID: 35252665
solved myself
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question