几个常用的js

 我在项目中长期运用这些js方法:

          <script type="text/javascript">
         //打开新窗口,居中
         function openwindow(url, name, iWidth, iHeight) {
             var url;                             //转向网页的地址;
             var name;                           //网页名称,可为空;
             var iWidth;                          //弹出窗口的宽度;
             var iHeight;                        //弹出窗口的高度;
             var iTop = (window.screen.height - parseInt(iHeight, 10)) / 2;       //获得窗口的垂直位置;
             var iLeft = (window.screen.width - parseInt(iWidth, 10)) / 2;           //获得窗口的水平位置;
             window.open(url, name, 'height=' + iHeight + ',width=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',toolbar=no,menubar=no,scrollbars=no,resizeable=no,location=no,status=no');
         }
     </script>

原文地址:https://www.cnblogs.com/wangyhua/p/4050639.html