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 ?
SwimmanAsked:
Who is Participating?
 
knightEknightCommented:
this worked for me:
<meta http-equiv="Refresh" content="0; URL=javascript:history.go(-2);">
0
 
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
 
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.

All Courses

From novice to tech pro — start learning today.