window.showModalDialog Way
function ShowDialog (URL) {
var iwidth=300; Window width
var iheight=200;//window Height
var itop= (window.screen.height-iheight)/2;
var ileft= (window.screen.width-iwidth)/2;
window.showModalDialog (URL,window, "dialogheight:" +iheight+ px; dialogwidth: "+iwidth+" PX;
Dialogtop: "+itop+"; Dialogleft: "+ileft+"; Resizable:no; Status:no;scroll:no ");
}
Notice the second argument here,window
4. mode window data not flush (cache) Problem
in the JSP page Add the following statement
<%
Response.setheader ("Pragma", "No-cache");
Response.setheader ("Cache-control", "No-cache");
Response.setdateheader ("Expires", 0);
%>
5, in the modal window, the link pops up a new window problem
Join <base target= "_self" between
6. no prompt to close the page method
function Closewin () {
var ua = navigator.useragent; var ie = navigator.appname== "Microsoft Internet Explorer"? True:false;
if (IE) {
var ieversion = parsefloat (ua.substring (Ua.indexof ("MSIE") +5,ua.indexof (";", Ua.indexof ("MSIE")));
if (ieversion< 5.5) {
var str = ';
Document.body.insertAdjacentHTML ("BeforeEnd", str);
Document.all.noTipClose.Click ();
} else {
Window.opener =null; Window.close ();
}
}else{
Window.close ()
}
}