內容描述:
1.點擊登陸按鈕,在頁面上彈出一個登陸框(該登陸框在原來頁面之上,原來頁面處於不能編輯狀態),
2. 輸入正確信息,登陸成功之後,該窗口關閉,原來頁面顯示新的URL的信息。
過程:
使用 showModalDialog 實現第一個點:
window.showModalDialog('page/login.jsp','','dialogLeft:'+ StartX + ';dialogTop:'+ StartY + '; dialogWidth:' + innerWidth +'; dialogHeight:' + innerHeight + '; resizable:no;center:yes;help:yes;resizable:yes;status:yes');
第二點,弄了好久才弄出來。code如下:
window.opener.top.location.href = '/Genome/index.jsp';
window.close();
先後試過很多方法,都沒有成功,比如:
window.opener.location.href = '/Genome/index.jsp';
window.opener.location.forward();
window.parent.location.href = '/Genome/index.jsp';
上面的幾個方法,在頁面上是可以顯示一點的,
比如:welcome,${user.username}是可以顯示爲:welcome,test
但點擊其他的tab或者menu時,就不管用了。而此時使用
window.open(url,'','') 卻是可以打開到你想要的頁面