[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how can i add to this code a previous page link using javascipt.

Posted on 2008-11-04
3
Medium Priority
?
205 Views
Last Modified: 2010-04-06
Hello i need to add to this javascipt condition back to previous page or history -1 and i need to check if the previous page was not in the domain http://www.audiomind.net get back to index page http://www.audiominds.net please give mthe full code based on this query below
if ( notification == "b")
	//add here the navigation details 			
 
 }
				else
				{
				document.getElementById("notification").innerHTML=notification;
				document.getElementById("txtstate").innerHTML=content;
				}

Open in new window

0
Comment
Question by:Audiominds
  • 2
3 Comments
 
LVL 7

Expert Comment

by:ASPSQLServerCOM
ID: 22877350
use

Hisotry object  - history.previous method
previous Property
The previous property contains the complete URL of the previous element in the History list, and is the equivalent of the URL the user would go to if they selected Back in the Go menu.
 
Syntax: history.previous


http://www.exforsys.com/tutorials/javascript/javascript-history-object-properties-and-methods.html


0
 

Author Comment

by:Audiominds
ID: 22879414
thanks ASPSQLServerCOM can anyone help add the code to my scipt showed above as i am a newbie with these stuff .
thanks.
0
 
LVL 7

Accepted Solution

by:
ASPSQLServerCOM earned 2000 total points
ID: 22879717

var url;
url=history.previous;
if(url.substring(0,24)<>'http://www.audiomind.net')
{
window.location = "http://www.audiomind.net"
}
 
are you looking to disable to back button? there are couple of ways to do that too

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question