1

我目前在我的网站上使用 Mixpanel。由于某些原因,它们会不时出现故障,从而使我的网站无法加载。

有没有一种方法可以使负载异步或其他一些想法,当他们有停机时间时它不会关闭我的网站?

这是代码:

<script>
    var mp_protocol = (("https:" == document.location.protocol) ? "https://" : "http://");
    document.write(unescape("%3Cscript src='" + mp_protocol + "api.mixpanel.com/site_media/js/api/mixpanel.js' type='text/javascript'%3E%3C/script%3E"));
</script>

谢谢

4

1 回答 1

1

不要记录。将其写入页面,附加它。

<script>
$( function(){
    var mp_protocol = (("https:" == document.location.protocol) ? "https://" : "http://");
    jQuery.getScript(unescape(mp_protocol + "api.mixpanel.com/site_media/js/api/mixpanel.js"));
});
</script>
于 2011-09-02T00:57:00.070 回答