【问题标题】:Referer when redirect with javascript使用 javascript 重定向时的引用者
【发布时间】:2017-08-06 01:42:29
【问题描述】:

我有一个 HTML 页面 A,我用window.open 打开 HTML 页面 B。然后我将 HTML 页面 B 重定向到 HTML 页面 C ,但我将 HTML 页面 A 作为引用者。我需要以 B 作为推荐人进入页面 C。

【问题讨论】:

  • 我使用这个脚本:code function newtab() { var w1 = window.open('https://www.google.fr'); setTimeout(function(){ red(w1); }, 3000); } function red(tab) { tab.location.assign('https://www.whatismyreferer.com'); }

标签: javascript html redirect referer


【解决方案1】:

因为主要的referer是Ahtml页面。

you can use window.location.href



window.location.href example:

window.location.href = 'http://www.google.com'; //Will take you to Google.

window.open() 示例:

window.open('http://www.google.com'); //This will open Google in a new window.

【讨论】:

    猜你喜欢
    • 2010-11-09
    • 2013-11-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-12
    相关资源
    最近更新 更多