Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 3rd, 2007, 03:43 AM
Registered User
 
Join Date: Jul 2007
Location: Pune, Maharastra, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Back Button

Hi everybody!
I m rumpa from India. i work as a s/w engg. I m in an ERP proj. Now for the same i have to write a code for Back button. Now as this is a huge project i just can go in all JSP and use Back Link or a Button. SO i want to use my footer.jsp which is being used by all the JSPs. so can neone help me for this. i want a piece of code which can solve my problem.

J Rumpa
Reply With Quote
  #2 (permalink)  
Old July 3rd, 2007, 04:21 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I didn't even know if it was possible but google does miracles. just search for "JavaScript page history" and you have the answer.
Code:
<a href="javascript:history.go(-1)">
Go Back
</a>
__________________________________________________ ________
I am DJ Kat...that's my name. Its a D and a J and a Kat with a K.
Reply With Quote
  #3 (permalink)  
Old July 3rd, 2007, 05:35 AM
Registered User
 
Join Date: Jul 2007
Location: Pune, Maharastra, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi MR. DJ Kat
Thanks for the reply!
I used it! but my problem is that once it comes to the Activity Page .... and if i then click on Back link it takes me to the Log in page which i dont want. any idea how can i do this..... DO u have ne idea abt Tag Lib? can it be done using it? i have no idea abt it!

J Rumpa
Reply With Quote
  #4 (permalink)  
Old July 3rd, 2007, 10:31 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

I don't have a clue what you mean with tag lib. But I don't think you need it anyway. Your activity page what is the back button suppose to do on that page. And is this the only page where the back button should have a different function or perhaps disabled?
Maybe you could show the result by giving a link

__________________________________________________ ________
I am DJ Kat...that's my name. Its a D and a J and a Kat with a K.
Reply With Quote
  #5 (permalink)  
Old July 4th, 2007, 03:56 AM
Registered User
 
Join Date: Jul 2007
Location: Pune, Maharastra, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mr. DJ Kat
thanks for your reply once again!
Actually once a User Enters using Valid Login Id and Password,
he/she comes to an Activity page.
In This Activity Page, On the left Hand side, Modules are lined up with hyperlinks
like for eg
AAA
HR
Sales
Services

....etc. and in the center of the page, it has the links coming under these Modules viz. AAA,HR,Sales,Services etc.....!
now when a user clicks AAA, in the center it will list the links falling under AAA. This all Appears on the Activity page only. Now if one clicks on any of these links ...like say Create User, Update User etc kind of Links coming under the AAA Module, he is then entered into details of that particular link for any transactions or report. Now that Activity page is nt seen nemore. A complete new JSP appears for this.Now if user keeps on navigating thru this BACK link it will once come to Activity page again Rite? now here is the problem tht once user reaches to Activity page ... and clicks on BACK link again on it, he is then directed to the Login page! which i dont want! i want tht if BACK link appearing on Activity page is clicked, user shoeuld be redirected again to Activity page only and nt to LOg in PAge.
Hope i m clear to you! please do let me know if u have ne problesm in getting my Problem. i need it urgently! Pleae HElp me!

J Rumpa
Reply With Quote
  #6 (permalink)  
Old July 4th, 2007, 05:07 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

what about disableing the back button on the page? If i recall correct your back button is in the footer section
the following code will work propperly

place this in your footer
Code:
<a href="javascript:backButton()">Go Back</a>
this in your head
[code]<script>
var activitypage=false;
function backButton(){
    if(activitypage==false){
        history.go(-1);
    }else{
        //window.location=
    }
}
</script>[code]


and this on your activity page to disable your backbutton(must be placed under the previous code)
Code:
<script>
activitypage=true;
</script>
__________________________________________________ ________
I am DJ Kat...that's my name. Its a D and a J and a Kat with a K.
Reply With Quote
  #7 (permalink)  
Old July 4th, 2007, 05:50 AM
Registered User
 
Join Date: Jul 2007
Location: Pune, Maharastra, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Kat! :)
No i would need it on activity page also! and yes u r rite .... i have this BACK link in footer.jsp itself! DIsabling ...of link or button i dont need! well neways ...i can do one thing! i will try out this same code! and see if it works. instead of disabling it i can redirect the page to activity.jsp. hope it works !

J Rumpa
Reply With Quote
  #8 (permalink)  
Old July 4th, 2007, 07:39 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if you want to reload the activity page change the folling
Code:
    }else{
        //window.location=
    }
into(url probably need to be corrected)
Code:
    }else{
        window.location="activitypage.jsp"
    }
__________________________________________________ ________
I am DJ Kat...that's my name. Its a D and a J and a Kat with a K.
Reply With Quote
  #9 (permalink)  
Old July 4th, 2007, 08:29 AM
Registered User
 
Join Date: Jul 2007
Location: Pune, Maharastra, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks KAt! let me try and see! will let u know by tom!:D

J Rumpa
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Back Button in IE kishor_ys BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 September 4th, 2006 09:05 AM
Back Button abdul_owiusa General .NET 1 November 11th, 2005 09:58 AM
problem with back button. gurucharan_cs Javascript 1 April 6th, 2005 07:12 AM
Back Button DARSIN General .NET 0 March 1st, 2005 08:00 AM
history.back or hitting the back button won't work lian_a Classic ASP Basics 4 July 29th, 2004 12:14 AM



All times are GMT -4. The time now is 05:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.