简体   繁体   English

检测是否直接访问了网站。是否可以?

[英]Detect if website was visited directly..is it possible?

It is possible to detect if my website was visited directly (by user typing in the address as the URL) or if they have visited it by a link they found elsewhere or by a google search result link? 可以检测是否直接访问了我的网站(通过用户输入地址作为URL),或者是否通过他们在其他地方找到的链接或通过Google搜索结果链接访问了我的网站? Is this even possible? 这有可能吗?

You can use: 您可以使用:

document.referrer

which returns 'A String, representing the URL of the document that loaded the current document. 它返回'A String,代表加载当前文档的文档的URL。 Returns the entire URL, including the protocol (like http://). 返回整个URL,包括协议(例如http://)。 If the current document was not opened through a link (for example, through a bookmark), an empty string is returned.' 如果当前文档没有通过链接(例如,通过书签)打开,则返回一个空字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我能否检测我的 PWA 是作为应用程序启动还是作为网站访问? - Can I detect if my PWA is launched as an app or visited as a website? CSS / JavaScript / hacking:检测:链接上的访问样式*没有*直接检查或比我更快 - CSS/JavaScript/hacking: Detect :visited styling on a link *without* checking it directly OR do it faster than me 检测Chrome中的访问链接 - Detect Visited Link In Chrome 根据上次访问的网站进行重定向 - Redirect based on last visited website 骨干路由器:直接访问了url,没有路由匹配 - Backbone router : url visited directly no route match 是否有可能从javascript获取锚访问状态? - is it possible to get anchor visited state from javascript? 通过URL直接访问时,Vue路由器设置工作 - Vue Router Setup work when visited directly via URL 是否可以从外部URL访问内部jQuery#链接(直接访问单个网站部分)? - Is it possible to access internal jQuery # links (access single website sections directly) from external url? 如何检测浏览器是否区分访问过的链接? - How do I detect if a browser distinguishes visited links? 我可以告诉在我的网站之前有人访问过的最后一个网站吗? - Can I tell the last website someone visited before my site?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM