历史 [英] History

查看:68
本文介绍了历史的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法获得访问的最后一页?我不想去那个页面,我只想找出他们来自哪个页面,

该页面的网址。这可能吗?

Is there a way to obtain the last page visited? I don''t want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?

推荐答案

Dan在12/3/2005 9:02 PM说了以下内容:
Dan said the following on 12/3/2005 9:02 PM:
有没有办法获得访问的最后一页?我不想去那个页面,我只是想找出他们来自哪个页面,
该页面的网址。这可能吗?
Is there a way to obtain the last page visited? I don''t want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?




号。谢天谢地。你可以尝试使用document.referrer,但它不会.......
总是告诉你他们来自哪个页面。


为什么你想知道我来自哪里来自?


-

兰迪

comp.lang.javascript常见问题 - http://jibbering.com/faq &新闻组每周

Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /



No. And thankfully so. You can try document.referrer but it won''t
always tell you what page they came from.

Why do you want to know where I came from?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Dan于2005年12月4日在comp.lang.javascript中写道
Dan wrote on 04 dec 2005 in comp.lang.javascript:
有没有办法获取访问的最后一页?我不想去那个页面,我只是想找出他们来自哪个页面,
该页面的网址。这可能吗?
Is there a way to obtain the last page visited? I don''t want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?




当然,如果它来自同一个域,你可以使用服务器端代码。


否,如果是来自其他网站并且没有被推荐,

页面无权知道securitywize。


-

Evertjan。

荷兰。

(用我的电子邮件地址替换所有带点的十字架)



Sure, if it is from the same domain, you can use serverside code.

No, if it is from an other site and not referred,
the page has no right to know securitywize.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Randy Webb写道:
Randy Webb wrote:
Dan在2005年12月3日下午9:02发表以下内容:
Dan said the following on 12/3/2005 9:02 PM:
有没有办法获得访问的最后一页?我不想去那个页面,我只是想找出他们来自哪个页面,
该页面的网址。这可能吗?
Is there a way to obtain the last page visited? I don''t want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?



不,谢天谢地。您可以尝试使用document.referrer,但它不会总是告诉您它们来自哪个页面。

您为什么想知道我来自哪里?



No. And thankfully so. You can try document.referrer but it won''t
always tell you what page they came from.

Why do you want to know where I came from?




发现这个:

http://www.samspublishing.com/librar...urs&seqNum=100


// //// COPY&粘贴:


历史对象是窗口对象的另一个子(属性)。这个

对象包含之前访问过的URL的信息和当前之后的
,它包括前一个或下一个的方法

位置。


历史对象有一个你可以访问的属性:


* history.length跟踪历史的长度lista ?? in other

字,用户访问过的不同位置的数量。


注意


历史对象具有当前,上一个和下一个属性,

存储历史列表中文档的URL。但是,出于安全原因,

这些对象在今天的浏览器中通常无法访问。


历史对象有三种方法可以用来移动通过历史

列表:


* history.go()从历史列表中打开一个URL。要使用此方法,

在括号中指定正数或负数。例如,

history.go(-2)相当于按两次返回按钮。

* history.back()在历史列表中加载以前的URL? ?相当于

按下后退按钮。

* history.forward()加载历史列表中的下一个URL(如果有)。

这相当于按下前进按钮。


// //结束粘贴

-

Etienne Marais
Cosmic Link

南非



Found this:
(http://www.samspublishing.com/librar...urs&seqNum=100)

////// COPY & PASTE :

The history object is another child (property) of the window object. This
object holds information about the URLs that have been visited before and
after the current one, and it includes methods to go to previous or next
locations.

The history object has one property you can access:

* history.length keeps track of the length of the history lista??in other
words, the number of different locations that the user has visited.

Note

The history object has current, previous, and next properties that
store URLs of documents in the history list. However, for security reasons,
these objects are not normally accessible in today''s browsers.

The history object has three methods you can use to move through the history
list:

* history.go() opens a URL from the history list. To use this method,
specify a positive or negative number in parentheses. For example,
history.go(-2) is equivalent to pressing the Back button twice.
* history.back()loads the previous URL in the history lista??equivalent to
pressing the Back button.
* history.forward()loads the next URL in the history list, if available.
This is equivalent to pressing the Forward button.

//// END PASTE
--
Etienne Marais
Cosmic Link
South Africa


这篇关于历史的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆