WPRAIN3 发表于 2015-6-16 10:55:26

LP代码求教---回帖的今年都发财

本帖最后由 WPRAIN3 于 2015-6-16 11:25 编辑

各位大拿好,小弟想更好的利用每个点击,想实现“用户在打开LP后进行后退或关闭当前LP的操作时,浏览器跳转到新的LP”这样的功能,不知道什么代码可以实现?
下面这段代码似乎可以,有其他更好的方法么?
<script type="text/javascript">
// offer 返回
         window.history.pushState('back.html', 'Back', 'back.html');
               //Landing page 返回
         window.history.pushState('index.php', 'index', 'index.php');
    </script>
             <script type="text/javascript">

         window.addEventListener("popstate", function(e) {
            if(document.URL.indexOf("back.html") >= 0){
                document.location.href = document.location;
            }
         });

    </script>
谢谢!



whitingday 发表于 2015-6-16 11:25:33

自用的逗b代码
<html>
<body>

<a id="auto" href="lp1"></a>

<script>
var links = [,
"lp1"
,"lp2"
,"lp3"
]
var id = document.getElementById("auto");
if(localStorage.num){
localStorage.num = parseInt(localStorage.num) + 1;
if(links){
    id.href = links;
    //alert(id.href);
    id.click();
    }else{
    localStorage.num = 1;
    id.href = links;
    id.click();
    //alert(id.href);
    }
}else{
localStorage.num = 1;
id.href = links;
id.click();
//alert(id.href);
}
//id.click();
</script>




</body>
</html>

spian2008 发表于 2015-6-16 11:20:30

好吧。为了发财才回的。其实我不懂你的问题。;P

WPRAIN3 发表于 2015-6-16 11:35:14

本帖最后由 WPRAIN3 于 2015-6-16 11:39 编辑

whitingday 发表于 2015-6-16 11:25
自用的逗b代码
谢谢谢谢谢谢谢谢!
我试试!

ysooo 发表于 2015-6-16 14:32:10

看2楼





54clz 发表于 2015-6-16 15:17:26

这段代码可以,干嘛要找其它方法

saveascj 发表于 2015-6-16 15:50:43

今年必须发财。
问题不懂。

隐逸逍遥 发表于 2015-6-16 16:14:07

为了发财也要回复呀。。。。
退谈代码 你这个挺好

帝尧故里 发表于 2015-6-16 16:33:24

今年必须发财。
问题不是很懂。

荒野小刀 发表于 2015-6-16 17:11:31

今年必须发财,可惜问题我也不懂

laoyebin 发表于 2015-6-16 22:40:11

就是这个帖子里的那个代码吧
http://www.advertcn.com/thread-14591-1-1.html

herrzy 发表于 2015-6-16 22:50:08

回帖纯粹为了发财

WPRAIN3 发表于 2015-6-17 13:55:59

laoyebin 发表于 2015-6-16 22:40
就是这个帖子里的那个代码吧

谢谢laoyebin!

心有些乱 发表于 2015-6-18 10:48:48

回帖也是为了发财谁不爱财?

bainuipl 发表于 2015-6-25 23:24:34


今年必须发财,可惜问题我也不懂
页: [1] 2
查看完整版本: LP代码求教---回帖的今年都发财