[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • 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

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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