LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2008, 09:11 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
onClick to return to the same part of HTML document


Is it possible to use the "onClick" event to return to the same part of an HTML page?

In a site that uses frames, I use the "onMouseOver" and "onMouseOut" events and get a return to the top of the page if the link is clicked.

This is OK because it gives access to another frame, which is what was wanted, but I could improve the script if it was possible to add the "onClick" event to return to the same part of the script (for example file#glossary_of_terms).

If it is possible, can you give an example of the code?

Thank you for your help.
 
Old 02-29-2008, 02:04 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can use:
Code:
<a href="javascript:" onClick="history.go(-1)">return</a>
to go back, if that's what you want to do.
 
1 members found this post helpful.
Old 02-29-2008, 04:47 AM   #3
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
Thank you for the answer.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
html return to top of page rblampain Programming 2 02-06-2008 04:28 AM
Saving part of a html document bruno buys Programming 2 07-17-2007 11:15 AM
Writing to HTML document after loading completes dlublink Programming 4 09-13-2006 08:53 AM
Fooling a HTML document? eantoranz Programming 11 11-11-2004 07:42 AM
Php to return a binary not html logicdisaster Programming 3 10-07-2004 01:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration