jquery如何实现返回键刷新

 No1.html:


<style>
    .fui-header a.backcom:before {
        content: " ";
        display: inline-block;
        -webkit-transform: rotate(45deg);
        -ms-transform: rotate(45deg);
        transform: rotate(45deg);
        height: 0.5rem;
        width: 0.5rem;
        border-width: 0 0 2px 2px;
        border-color: #666;
        border-style: solid;
        position: relative;
        top:0;
    }
</style>

<div class="fui-header">
     <a class="backcom"></a>
</div>

<script>
    $(document).ready(function ()
    {
        var url = location.href;
        var times = url.split("&");
        var index = times.indexOf('r=order.create');
        times.splice(index, 1);
        url = times.join("&");
        url += "&r=member.cart&1";
        alert(url);
        $(".backcom").attr("href",url);
        /*此处只是个例子可以看逻辑就是在当前的url上拼接一个1*/
    })
</script>

No2.html

<script>
    $(document).ready(function ()
    {
        var url = location.href;
        var times = url.split("&");
        if (times.indexOf('1') != -1) {
            var index = times.indexOf('1');
            times.splice(index, 1);
            url = times.join("&");
            self.location.replace(url);
            if(times.indexOf('1') == -1)
			{
                window.location.href(url);
			}
        }
    })
    /*此处的代码直接粘贴到要跳转的那个页面就可以了,会实现跳转至此页面进行刷新操作,具体逻辑当时写完忘记啦哈哈哈*/
<script/>

上面style样式是一个返回键头的样式  如下图

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值