首页 > 代码库 > 点击浏览器的返回按钮或手机的返回按钮让页面刷新

点击浏览器的返回按钮或手机的返回按钮让页面刷新

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="wispanh=device-wispanh, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> 
<META HTTP-EQUIV="Expires" CONTENT="0">
<script src=http://www.mamicode.com/"//cdn.bootcss.com/jquery/3.1.0/jquery.min.js"></script>
<script src=http://www.mamicode.com/"//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script>
            $first=$.cookie(first_vist);
            if(!$first||$first==null||$first==null){
                $.cookie(first_vist,1,{ expires: 7 });
            }else{
                $.cookie(first_vist,null);
                location.reload(true);
            }
</script>
</head>

 

点击浏览器的返回按钮或手机的返回按钮让页面刷新