Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

basic one !

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
Swimman
Asked:
Swimman
  • 2
  • 2
1 Solution
 
a.marshCommented:
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
 
SwimmanAuthor Commented:
ok good but what is the problem with this :

<meta http-equiv="Refresh" content="0; URL=javascript:history.back(2)">
0
 
knightEknightCommented:
this worked for me:
<meta http-equiv="Refresh" content="0; URL=javascript:history.go(-2);">
0
 
a.marshCommented:
What?!?!

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

Ant
0
 
knightEknightCommented:
I don't either ... it was just a shot in the dark.  :\
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now