Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Scripts

Reply
 
LinkBack Thread Tools Display Modes
Old 02-25-2010, 07:20 PM   #1
New Member
 
Join Date: Feb 2010
Posts: 6
Default Back to previous page

Hello guys,

I have a question:
Is there a possibility that if someone clicks on a link, he goes back to the previous page?

It would be awesome if it fits in:
Code:
<a href="#" and </a>
If I can modify the ''#'' somehow in a way that if would return to the previous page.

Thank you!!!!!!!!!
Skipito is offline   Reply With Quote


Old 03-22-2010, 12:47 AM   #2
New Member
 
Join Date: May 2009
Posts: 11
Default

I use a Javascript function

Code:
function prevPage() {
	history.back();
}
and then call it in the link
Code:
<a href="javascript:prevPage()">Back to previous page</a>
NOTE: You may be able to just use "javascript:history.back()" in the link instead of calling the function. I haven't tried it.
munkyeetr is offline   Reply With Quote
Old 03-23-2010, 10:20 AM   #3
Bronze Member
 
Join Date: Mar 2010
Location: Norfolk, UK
Posts: 78
Default

Here are a couple more variants (no functions required):

Code:
<input type=button value="back" onclick="history.go(-1)" />
Code:
 <a class="button" onClick="history.go(-1)" title="go back" >< go back</a>
I tend to use the second option myself.
__________________
Website Design in Norfolk
Twitter
craftygeek is offline   Reply With Quote
Old 04-02-2010, 04:10 AM   #4
Silver Member
 
Join Date: Dec 2009
Location: Minnesota
Posts: 136
Default

Quote:
Originally Posted by craftygeek View Post
Here are a couple more variants (no functions required):

Code:
<input type=button value="back" onclick="history.go(-1)" />
Code:
 <a class="button" onClick="history.go(-1)" title="go back" >< go back</a>
I tend to use the second option myself.
I also use the second line of code quite often..simple and effective.
__________________
Minnesota Web Development
rwebber77 is offline   Reply With Quote
Old 04-19-2010, 02:28 AM   #5
New Member
 
Join Date: Apr 2010
Posts: 7
Default

<SCRIPT language="JavaScript">
{
//window.location="http://www.davidrfreelandjr.com/zmail-inquiry4.htm";
window.location=document.referrer;

}
</SCRIPT>

stick that in tha page the link targets, it will open the page for 1/10th of a second, and send them back whereever they cames from

<body onunload="KeepThemHere">

above, stick a function call from the onunload event, never done it, but you could do like:

function KeepThemHere() {
window.location="http://www.yourSite.com/thePageTheyWereAt.htm";

}

Last edited by 10west; 04-19-2010 at 02:44 AM. Reason: unknown
10west is offline   Reply With Quote


Reply

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:05 AM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.