简体   繁体   English

在新标签页中获取引荐网址

[英]Get referral Url in new tab

If you click on a link and it opens in a new tab, in that new tab you have some Javascript that gets the referral url but the referral url equals nothing or undefined. 如果单击链接,并且该链接在新选项卡中打开,则在该新选项卡中,您有一些Javascript可获取引荐网址,但引荐网址不等于或未定义。

I want to know if it is possible to get the referral url even when the link has been opened in a new tab. 我想知道即使在新标签页中打开了链接,也可以获得参考网址。

Yes this is doable. 是的,这是可行的。 In the new tab's JavaScript you can write 在新标签页的JavaScript中,您可以编写

alert(document.referrer);

Know more about Document Referrer . 了解更多有关Document Referrer的信息

You can also do this in PHP. 您也可以在PHP中执行此操作。 Check this Get original URL referer with PHP 选中此使用PHP获取原始URL引用

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM