获取重定向到此页面的URL

Ven*_*lev 0 javascript referrer

在这段代码中:

if (screen.width <= 800) {
    window.location = "http://www.megaoferta.bg/mobile";
}
Run Code Online (Sandbox Code Playgroud)

如何识别使用JavaScript打开页面的URL?

例如,如果用户从Google搜索进入我的网页,我该如何使用JavaScript获取"google.com"页面?

Sea*_*n F 6

您可以使用文档引荐来源:

var x = document.referrer;
Run Code Online (Sandbox Code Playgroud)