zoukankan      html  css  js  c++  java
  • 前端_打开新窗口(openWindow)

    function login(type){
    var url = "http://runjs.cn/action/openid/before_login?op=" + type;
    openwindow(url, 'loginPage', 800, 600);
    }
    function logout(uid){
    jQuery.post("/action/ajax/logout",'uid='+uid, function(msg) {
    location.href="/";
    });
    }
    function openwindow(url, name, iWidth, iHeight) {
    var url; // 转向网页的地址;
    var name; // 网页名称,可为空;
    var iWidth; // 弹出窗口的宽度;
    var iHeight; // 弹出窗口的高度;
    var iTop = (window.screen.availHeight - 30 - iHeight) / 2; // 获得窗口的垂直位置;
    var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; // 获得窗口的水平位置;
    window.open(url,name,
    'height='
    + iHeight
    + ',,innerHeight='
    + iHeight
    + ',width='
    + iWidth
    + ',innerWidth='
    + iWidth
    + ',top='
    + iTop
    + ',left='
    + iLeft
    + ',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
    } 
    簡單的例子,混著用這兩種開窗:

    open 代表 window.open
    modal 代表 window.showModalDialog


    Y = session 還在
    N = session 不見了

    連續開窗使用方式 Session是否仍然存在
    open/open/open Y/Y/Y
    modal/modal/modal Y/Y/Y
    open/modal/open Y/Y/N
    modal/open/modal Y/N/N
    open/modal/modal Y/Y/Y

  • 相关阅读:
    323. Number of Connected Components in an Undirected Graph
    418. Sentence Screen Fitting
    417. Pacific Atlantic Water Flow
    416. Partition Equal Subset Sum
    415. Add Strings
    245. Shortest Word Distance III
    [AHOI2009]维护序列
    [洛谷P1439]排列LCS问题
    [Vijos P1369]难解的问题
    [codevs3657]括号序列
  • 原文地址:https://www.cnblogs.com/logep/p/3526517.html
Copyright © 2011-2022 走看看