Link to home
Start Free TrialLog in
Avatar of Swimman
Swimman

asked on

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 ?
Avatar of a.marsh
a.marsh

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
Avatar of Swimman

ASKER

ok good but what is the problem with this :

<meta http-equiv="Refresh" content="0; URL=javascript:history.back(2)">
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What?!?!

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

Ant
I don't either ... it was just a shot in the dark.  :\