欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

javascript 打开子窗口例子

程序员文章站 2021-12-17 21:58:42
...
<input type="button" name="viewCourse" value="查看" onclick="openSubWindow('link.html',1)" />


var SUBWINDOW_WIDTH = "800px";
var SUBWINDOW_HEIGHT = "600px";
var SUBWINDOW_CENTER = "Yes";
var SUBWINDOW_HELP = "No";
var SUBWINDOW_RESIZABLE = "No";
var SUBWINDOW_STATUS = "No";

function openSubWindow(){
var dialogUrl;
var dialogType;
var parentItems;
var queryString;
var width = SUBWINDOW_WIDTH;
var height = SUBWINDOW_HEIGHT;
var returnValue = null;
if( 2 <= arguments.length && arguments.length <= 5){
dialogUrl = openSubWindow.arguments[0];
dialogType = openSubWindow.arguments[1];
queryString = dialogUrl;
}
futures = "dialogWidth="+width+"; dialogHeight="+height+"; center="+SUBWINDOW_CENTER+"; help="+SUBWINDOW_HELP+"; resizable="+SUBWINDOW_RESIZABLE+"; status="+SUBWINDOW_STATUS;
if(dialogType==1){
window.showModalDialog(queryString, window, futures);
}else if(dialogType==2){
subWinOj = window.showModelessDialog(queryString,window,futures);
}
}
相关标签: JavaScript