Need a little piece of website code

blackroseMD1

(nothing can stop me now)
Guru
Gold Member
VIP
Local time
1:58 PM
Messages
1,658
Location
San Diego, CA
Hey guys,
So, I'm working on the new website for the organization that I work for, and it's coming along really well. The problem that I am having is that, while I know html inside and out, I pretty much know nothing about Java. What I need is a bit of code where I can have a link that will take the person back to the last page they were on. Can anyone help me out?

Thanks,
Brian
 

My Computer My Computer

At a glance

Windows 10 Tech Preview 9926 x64AMD FX-835016GB DDR3 1333Asus R9 290 DirectCU II OC, Gigabyte Windforc...
Computer type
PC/Desktop
Computer Manufacturer/Model Number
SuperBeast
OS
Windows 10 Tech Preview 9926 x64
CPU
AMD FX-8350
Motherboard
Gigabyte GA-990FXA-UD3
Memory
16GB DDR3 1333
Graphics Card(s)
Asus R9 290 DirectCU II OC, Gigabyte Windforce R9 290 OC
Sound Card
Integrated w/ Creative A250 2.1 speakers
Monitor(s) Displays
Main: Asus VN289H 28" Secondary: Acer G246HL 24"
Screen Resolution
1920x1080
Hard Drives
128 GB SanDisk Ultra Plus (Windows drive)

240 GB Crucial M500 SSD (Games drive)

1 TB WDC WD10EACS 7200RPM HDD (Data drive)

2 TB Seagate Expansion Desktop external HDD (Backup drive)
PSU
900w Antec HCG-900
Case
Raidmax Agusta Full ATX
Cooling
Corsair H80
Keyboard
Cooler Master Devastator MB24
Mouse
Cooler Master Devastator MS2K 1000/1600/2000 DPI
Internet Speed
100Mbps cable
Antivirus
Avast!
Browser
Chrome
It's pretty simple. JavaScript has the history object. Just off the top of my head, iirc, it's just something like

Code:
<a href="javascript:history.go(-1)">Previous Page</a>

or

Code:
<a href="javascript:history.back()">Previous Page</a>

The number in the parenthesis is the amount of pages to go back in the history, so changing it to -2 would put the user 2 pages back, and so on. Changing it to a positive number, so just 1, 2 etc, lets the user go forward in history.
 

My Computer My Computer

At a glance

Windows 8.1 Pro x64Intel Core i7 4790k8GB Corsair Dominator 1600MHzMSI TwinFrozr GeForce GTX770
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Built
OS
Windows 8.1 Pro x64
CPU
Intel Core i7 4790k
Motherboard
MSI Z97S Krait Edition
Memory
8GB Corsair Dominator 1600MHz
Graphics Card(s)
MSI TwinFrozr GeForce GTX770
Sound Card
ASUS Xonar DX/XD 7.1
Monitor(s) Displays
Dell 24" S2409W + Dell 20" E207WFP
Screen Resolution
1920x1080 + 1680x1050
Hard Drives
1x 120GB OCZ Agility 3, 1x 750GB Western Digital Caviar Black, 1x 1TB Western Digital Caviar Blue
PSU
Corsair HX850 modular
Case
Fractal Design Define R4
Cooling
Corsair H60 w/ twin Corsair SP120 fans
Keyboard
Logitech G510S Keyboard
Mouse
Logitech G500S Laser Mouse
Internet Speed
40Mbps
Antivirus
Microsoft Security Essentials
Browser
Google Chrome
Other Info
LG Blu-Ray player
Awesome, it works great. Thanks Everlong!
 
Last edited:

My Computer My Computer

At a glance

Windows 10 Tech Preview 9926 x64AMD FX-835016GB DDR3 1333Asus R9 290 DirectCU II OC, Gigabyte Windforc...
Computer type
PC/Desktop
Computer Manufacturer/Model Number
SuperBeast
OS
Windows 10 Tech Preview 9926 x64
CPU
AMD FX-8350
Motherboard
Gigabyte GA-990FXA-UD3
Memory
16GB DDR3 1333
Graphics Card(s)
Asus R9 290 DirectCU II OC, Gigabyte Windforce R9 290 OC
Sound Card
Integrated w/ Creative A250 2.1 speakers
Monitor(s) Displays
Main: Asus VN289H 28" Secondary: Acer G246HL 24"
Screen Resolution
1920x1080
Hard Drives
128 GB SanDisk Ultra Plus (Windows drive)

240 GB Crucial M500 SSD (Games drive)

1 TB WDC WD10EACS 7200RPM HDD (Data drive)

2 TB Seagate Expansion Desktop external HDD (Backup drive)
PSU
900w Antec HCG-900
Case
Raidmax Agusta Full ATX
Cooling
Corsair H80
Keyboard
Cooler Master Devastator MB24
Mouse
Cooler Master Devastator MS2K 1000/1600/2000 DPI
Internet Speed
100Mbps cable
Antivirus
Avast!
Browser
Chrome
You're welcome :)
 

My Computer My Computer

At a glance

Windows 8.1 Pro x64Intel Core i7 4790k8GB Corsair Dominator 1600MHzMSI TwinFrozr GeForce GTX770
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Built
OS
Windows 8.1 Pro x64
CPU
Intel Core i7 4790k
Motherboard
MSI Z97S Krait Edition
Memory
8GB Corsair Dominator 1600MHz
Graphics Card(s)
MSI TwinFrozr GeForce GTX770
Sound Card
ASUS Xonar DX/XD 7.1
Monitor(s) Displays
Dell 24" S2409W + Dell 20" E207WFP
Screen Resolution
1920x1080 + 1680x1050
Hard Drives
1x 120GB OCZ Agility 3, 1x 750GB Western Digital Caviar Black, 1x 1TB Western Digital Caviar Blue
PSU
Corsair HX850 modular
Case
Fractal Design Define R4
Cooling
Corsair H60 w/ twin Corsair SP120 fans
Keyboard
Logitech G510S Keyboard
Mouse
Logitech G500S Laser Mouse
Internet Speed
40Mbps
Antivirus
Microsoft Security Essentials
Browser
Google Chrome
Other Info
LG Blu-Ray player
Back
Top