• 前端_打开新窗口(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

  • 相关阅读:
    HDU 2476 String painter (*区间DP+基础Dp)
    hdoj 1405 The Last Practice
    hdu 2715 Herd Sums
    hdu 3617 Happy 2009
    hdu 1062 Text Reverse
    hdu 2716 Message Decowding
    hdu 1597 find the nth digit
    hdoj 1229 还是A+B
    hdu 1877 又一版 A+B
    hdoj 2045 不容易系列之(3)—— LELE的RPG难题
  • 原文地址:https://www.cnblogs.com/logep/p/3526517.html
Copyright © 2020-2023  润新知