Solved

basic one !

Posted on 2002-04-11
5
275 Views
Last Modified: 2006-11-17
how could i write in the document the current url of the current page and how could i write in the document the previous page url ?
0
Comment
Question by:Swimman
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6935258
Try this:

<html>
<head>
</head>
<body>
<script language="javascript" type="text/javascript">
document.write("<p>Current url: " + window.location.href + "</p>");
document.write("<p>Previous url: " + document.referrer + "</p>");
</script>
</body>
</html>

Note that you won't always get document.referrer - depends on how the page was called.

:o)

Ant
0
 

Author Comment

by:Swimman
ID: 6935342
ok good but what is the problem with this :

<meta http-equiv="Refresh" content="0; URL=javascript:history.back(2)">
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 50 total points
ID: 6935355
this worked for me:
<meta http-equiv="Refresh" content="0; URL=javascript:history.go(-2);">
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6936203
What?!?!

I don't understand what that has to do with your original question?

Ant
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6936752
I don't either ... it was just a shot in the dark.  :\
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Window.Open() is showing a blank page 9 30
How do specify keydowns in JavaScript 3 42
jquery datepciker end date add 6 days 6 33
JavaScript let vs var 5 20
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

816 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now