X
X l e c t r i c
Hi,
I'm trying to put the last URL visited to a text input using
history.previous for WebTV (because I can't get document.referrer to
work with WebTV) and document.referrer for PC. This is for my Web
Resources page. Where if I go straight to it from an image that I want
to edit with an online imaging tool, or if I go straight to it from a
page that I want to validate, I can put the URL to the text input of the
portal I want to use.
I'm getting varied results with the PC (IE6). When I click on the page
that has this in my file manager it works. But when I access the page
from my favorites it doesn't work.
Here's a link to an example/test page:
http://www.xlectric.com/resources/lasttest.html
Below is the code for the forms and JavaScript that I'm using.
Thanks for any help.
Later, Art.
<form action="javascript:void()" onsubmit="return false;">
Last URL
<br />
<input type="text" id="last" size="50" />
</form>
<form id="last2" action="javascript:void()" onsubmit="return false;">
<p>
<a href="javascript:showLast('last2');">Show Last URL</a>
<a
href="javascript:document.getElementById('last2').reset();">Reset</a>
<br />
<input type="text" size="50" />
</p>
</form>
<script type="text/javascript">
<!-- Xlectric Script
var s_last;
if (navigator.appName.indexOf("WebTV") != -1)
{
s_last = history.previous;
}
else
{
s_last = document.referrer;
}
document.getElementById("last").value = s_last;
function showLast(f_last)
{
document.getElementById(f_last).elements[0].value = s_last;
}
//-->
</script>
I'm trying to put the last URL visited to a text input using
history.previous for WebTV (because I can't get document.referrer to
work with WebTV) and document.referrer for PC. This is for my Web
Resources page. Where if I go straight to it from an image that I want
to edit with an online imaging tool, or if I go straight to it from a
page that I want to validate, I can put the URL to the text input of the
portal I want to use.
I'm getting varied results with the PC (IE6). When I click on the page
that has this in my file manager it works. But when I access the page
from my favorites it doesn't work.
Here's a link to an example/test page:
http://www.xlectric.com/resources/lasttest.html
Below is the code for the forms and JavaScript that I'm using.
Thanks for any help.
Later, Art.
<form action="javascript:void()" onsubmit="return false;">
Last URL
<br />
<input type="text" id="last" size="50" />
</form>
<form id="last2" action="javascript:void()" onsubmit="return false;">
<p>
<a href="javascript:showLast('last2');">Show Last URL</a>
<a
href="javascript:document.getElementById('last2').reset();">Reset</a>
<br />
<input type="text" size="50" />
</p>
</form>
<script type="text/javascript">
<!-- Xlectric Script
var s_last;
if (navigator.appName.indexOf("WebTV") != -1)
{
s_last = history.previous;
}
else
{
s_last = document.referrer;
}
document.getElementById("last").value = s_last;
function showLast(f_last)
{
document.getElementById(f_last).elements[0].value = s_last;
}
//-->
</script>