Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
异步Javascript加载之前的页面重定向_Javascript_Html_Redirect_Asynchronous_Mixpanel - Fatal编程技术网

异步Javascript加载之前的页面重定向

异步Javascript加载之前的页面重定向,javascript,html,redirect,asynchronous,mixpanel,Javascript,Html,Redirect,Asynchronous,Mixpanel,我正在尝试创建一个重定向页面,用mixpanel.track 问题是,在异步javascript有时间下载和运行之前,页面会重定向。我该怎么办 这是我的密码 编辑:我把代码放在问题里 <!DOCTYPE HTML> <html lang="en-US"> <head> <!-- start Mixpanel --><script type="text/javascript">(function(f,b){if(!b.__SV){var

我正在尝试创建一个重定向页面,用
mixpanel.track

问题是,在异步javascript有时间下载和运行之前,页面会重定向。我该怎么办

这是我的密码

编辑:我把代码放在问题里

<!DOCTYPE HTML>
<html lang="en-US">
<head>

<!-- start Mixpanel --><script type="text/javascript">(function(f,b){if(!b.__SV){var a,e,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=f.createElement("script");a.type="text/javascript";a.async=!0;a.src="//cdn.mxpnl.com/libs/mixpanel-2.2.min.js";e=f.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}})(document,window.mixpanel||[]);
mixpanel.init("9f85e6edf009562d5ac2c944b0da6398");mixpanel.track("CBhopID_x3cw17x1h")</script><!-- end Mixpanel -->

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="1;url=http://e20f07o0yd5b2re0-x3cw17x1h.hop.clickbank.net/" http-equiv="refresh" />

<script type="text/javascript">
window.location.href = "http://e20f07o0yd5b2re0-x3cw17x1h.hop.clickbank.net/"
</script>

<title>Redirecting...</title>
</head>
<body>
<p>If you are not redirected automatically, follow <a href="http://e20f07o0yd5b2re0-x3cw17x1h.hop.clickbank.net/">this link.</a></p>
</body>
</html>

(f,b)若(f,b)若(f,b)若(f,b)若(f,b)若(f,b)若(f,b)若(f,b)若(f,b)若(f,b,b)若(f,b,b)若(f,b,b,b)若(f,b,b,b,b)若(f,b,b,b,b,b,b,b,b)若(f,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,tring=函数(b){var a=“mixpanel”;“mixpanel”!==d&&(a++=”+d);b | |(a++=“(存根)”;返回a};c.people.toString=function(){return c.toString(1)+“.people(存根)”};i=”禁用跟踪跟踪页面查看跟踪链接跟踪表单注册一次别名取消注册标识名称设置设置人员配置设置人员设置一次人员增量人员追加人员跟踪收费人员清除收费人员删除用户拆分(“”);
对于(g=0;g具有在跟踪事件后调用的回调选项,您需要使用它,在回调时您可以重定向到某个位置,将您的
窗口放置在回调函数中。位置
代码,如:

mixpanel.track("CBhopID_x3cw17x1h", {}, function() {
   window.location.href = "http://e20f07o0yd5b2re0-x3cw17x1h.hop.clickbank.net/";
});

@T.J.Crowder很高兴知道,谢谢。