mip网站添加快商通链接实现来路轨迹显示

在搭建mip网站时,大家都知道是没法加载外站js链接的,所以我通过mip自带的mip-iframe来插入代码

注意:网站必须是https:// 

在mip页面添加

<mip-iframe src="https:/www.test/swt.html" width="0" height="0">mip-iframe>
swt.html
<script>    
document.cookie = "pref="+escape(window.parent.document.referrer)+";path=/";
document.cookie = "phref="+escape(window.parent.location.href)+";path=/";
var swtjs=document.createElement("script");
swtjs.src="https://test.kuaishang.cn/bs/ks.j?cI=168168&fI=1136";
window.parent.document.body.appendChild(swtjs);
console.log("pref="+escape(window.parent.document.referrer));
console.log("phref="+escape(window.parent.location.href));
script>

 

转载于:https://www.cnblogs.com/linyusong/p/10364194.html

你可能感兴趣的:(mip网站添加快商通链接实现来路轨迹显示)