Go back without using javascript

This is a discussion on "Go back without using javascript" within the JavaScript Forum section. This forum, and the thread "Go back without using javascript are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 14th, 2007, 14:03
New Member
Join Date: Dec 2007
Location: CANADA
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Go back without using javascript

Hi all ,

As known to go back we use :
Code: Select all
<A HREF="javascript:history.go(-1)">Go back </A>
Is there any way NOT to use javascript to go back to the pervious page

Thanks in Advance
Reply With Quote

  #2 (permalink)  
Old Dec 14th, 2007, 14:21
welshstew's Avatar
Lead Administrator

SuperMember
Join Date: May 2007
Location: inside the outside
Posts: 1,388
Blog Entries: 13
Thanks: 1
Thanked 17 Times in 15 Posts
Re: Go back without using javascript

I would use the big back button at the top of your browser....

Seriously though, I do not think there is a way to go back in your browser history without some sort of scripting.
__________________
WelshStew
Lead Administrator

tierney rides tboard - uk site | xtreme wales - extreme clothing
If you think I've helped, click the "Thanks"
webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
Reply With Quote
  #3 (permalink)  
Old Dec 14th, 2007, 14:30
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: Go back without using javascript

HTML is static!
COMPLETELY STATIC, DEAD, INACTIVE.....
HyperText Markup Language....
It FORMATS text and nothing else....!!!

</outburst>
Reply With Quote
  #4 (permalink)  
Old Dec 14th, 2007, 14:35
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Go back without using javascript

Quote:
Originally Posted by c010depunkk View Post
HTML is static!
COMPLETELY STATIC, DEAD, INACTIVE.....
HyperText Markup Language....
It FORMATS text and nothing else....!!!

</outburst>
Hmmm ... are you trying to tell us something? :rofl:

To OP ... no ... without JS or using the browsers' back button or right-click on the page and select Back or the ALT + left arrow, there is no way of going back to the previous page.
Reply With Quote
  #5 (permalink)  
Old Dec 14th, 2007, 14:43
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Go back without using javascript

Don't try to build a complete user interface for your site. That's what a browser is for!

Let them use the back button.
Reply With Quote
  #6 (permalink)  
Old Dec 14th, 2007, 16:37
c010depunkk's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to c010depunkk
Re: Go back without using javascript

Quote:
Originally Posted by karinne View Post
Hmmm ... are you trying to tell us something? :rofl:
Yeah, that you can't do this with HTML
Reply With Quote
  #7 (permalink)  
Old Dec 14th, 2007, 16:51
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,649
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: Go back without using javascript

haha... Good answer Jan!!!
Reply With Quote
  #8 (permalink)  
Old Dec 14th, 2007, 17:04
Aso's Avatar
Aso Aso is online now
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,011
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: Go back without using javascript

On a serious note

Could a spot of PHP and the use of $_SERVER['HTTP_REFERER'] be put to use?

Something like
PHP: Select all

<?php
if (isset($_SERVER['HTTP_REFERER'])) {
echo 
'<a href="'.$_SERVER['HTTP_REFERER'].'">Go Back</a>';
}
?>
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #9 (permalink)  
Old Dec 14th, 2007, 20:48
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,649
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: Go back without using javascript

Yes, you can do that and it will work.
Reply With Quote
  #10 (permalink)  
Old Dec 14th, 2007, 21:40
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Go back without using javascript

Doesn't work for me...
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Reply With Quote
  #11 (permalink)  
Old Dec 14th, 2007, 21:53
Reputable Member
Join Date: Apr 2007
Location: Scotland
Age: 17
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Blake121
Re: Go back without using javascript

It works fine for me. Are you sure that your server supports the HTTP_REFERRER superglobal?

Or maybe you just made a direct access to the page and there is no referrer?

Check the source and see what it has in the link.
Reply With Quote
  #12 (permalink)  
Old Dec 14th, 2007, 22:48
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,649
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: Go back without using javascript

It also works for me.
Reply With Quote
  #13 (permalink)  
Old Dec 15th, 2007, 00:18
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Go back without using javascript

Oh, sorry guys! It's disabled on my server...
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Reply With Quote
  #14 (permalink)  
Old Dec 15th, 2007, 06:53
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Go back without using javascript

Sort of defeats the purpose though because a lot of browsers and servers don't set the HTTP_REFERER variable, not mention the fact that because it's a HTTP header, it can be modified.

Better off sticking with javascript (with a fallback to the HTTP header) or hard coding the links.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Reply With Quote
Reply

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
opera, back button & javascript interval paza JavaScript Forum 4 May 23rd, 2008 21:19
I'm back :P Weird1993 Introduce Yourself 8 Jan 5th, 2008 13:43
Back buton - several pages back - in HTML ? attila001122 Web Page Design 1 Dec 9th, 2007 15:51
Post back to default page when generate javascript deepgrid in asp.net zacklau JavaScript Forum 1 Oct 2nd, 2007 10:18
Problem with Javascript Back Button in Firefox gorikain JavaScript Forum 4 Jun 25th, 2007 22:23


All times are GMT. The time now is 01:08.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43