html5之获取url参数和右键菜单

来源:互联网 发布:淘宝电脑店 编辑:程序博客网 时间:2024/05/16 16:08
    <script type="text/javascript">


        function LoadUrlGetValues(key) {
            var regs = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
            var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
            var result = window.location.search.substr(1).match(reg);
            return result ? decodeURIComponent(result[2]) : null;
        }
        var Lid = LoadUrlGetValues('id');
        if (Lid == null) {
            //alert(1);
        } else if (Lid == undefined) { } else {
            document.title = Lid;

        } 

//获取参数id多个的话用并且

        // window.onload=function(){
        //       window.onmousedown = function () {
        //             if (window.event) {
        //                 if (event.button == 2) {
        //                      alert('欢迎使用创想3D全景VR!');
        //                      return false;
        //                 }
        //             }
        //         }
        // };
        //右键菜单




    </script>