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

 

posted @ 2014-01-20 10:09  logep  阅读(895)  评论(0编辑  收藏  举报