Solved

back button

Posted on 2011-03-09
6
437 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
[X]
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
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

710 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