window.lacation.replace

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <title>lacation[replace]应用</title>
    </head>
    <body>
        <script type="text/javascript">
            function resizeZ(){
                if(window.screen.width<600){
                    window.location.replace('http://www.baidu.com');
                }else{
                    window.location.replace('http://javascript.ruanyifeng.com/bom/window.html');
                }
            }
            window.onresize = resizeZ;
        </script>
    </body>
</html>

 

posted @ 2016-05-25 11:03  黑客PK  阅读(302)  评论(0编辑  收藏  举报