公共方法:
/*******************************************************************************
* 打开模式窗口
*/
function openMoodaDialog(sdesc, surl, swidth, sheight) {
var iWidth = 750;
var iHeight = 500;
if (swidth && swidth > 0) {
iWidth = swidth;
}
if (sheight && sheight > 0) {
iHeight = sheight;
}
var left = (window.screen.availWidth - iWidth) / 2;
var top = (window.screen.availHeight - iHeight) / 2;
var features = "scrollbars=yes;location=no;toolbar=no;resizable=yes;help=no;status=no;center=yes;dialogTop="
+ top
+ ";dialogLeft="
+ left
+ ";dialogHeight="
+ iHeight
+ "px;dialogWidth=" + iWidth + "px;";
if(surl.indexOf("?")!=-1){
surl = surl+"&td="+new Date().getTime();
}else{
surl = surl+"?td="+new Date().getTime();
}
// 将window传给子窗口
var childwin = window.showModalDialog(surl, window, features);
return childwin;
}
调用方法:
function add(){
var surl="bp-bank-exrate!add.action";
var vReturnValue = openMoodaDialog("",surl,750, 400);
if(vReturnValue == "close"){
window.opener=null;
window.location.reload();//重新加载父窗口
}
}
新增方法:
$(function($)
$("#formadd").attr("action","bp-merchant-fee-rule!save.action");
$("#formadd").submit();
window.returnValue="close";
});
相关推荐
javascript代码模块之\Window.ShowModalDialog使用手册
Window.ShowModalDialog使用手册_对话框 .txt 详细
showModalDialog使用例子,父窗口向子窗口传递值,子窗口设置父窗口的值,子窗口关闭的时候返回值到父窗口 纯js 应用广泛 应用广泛
主要介绍了浅谈JavaScript窗体Window.ShowModalDialog使用,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
showModalDialog和showModelessDialog使用心得
作者:norika 整理日期:2004年6月17日 基本介绍: showModalDialog() (IE 4+ ... 使用方法: vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures]) vReturnValue = window.showMod
showModalDialog及dialogArguments使用
NULL 博文链接:https://qsfwy.iteye.com/blog/587749
Selenium目前没有提供对IE模态对话框(即通过showModalDialog方法打开的弹出对话框)的处理。原因在于,模态对话框会将父页面的 JS挂起,直至对话框处理完毕才会继续执行父页面JS。因为Selenium的底层实现是基于JS的,...
javascript代码模块之如何使用showModalDialog
div层实现showModalDialog
This is a `window.showModalDialog()` shim using a modal HTML5 `<dialog>` element and ECMAScript 6 Generators. It was tested in the latest Google Chrome with the *Enable Experimental JavaScript* flag ...
针对window.showmodaldialog弹出窗体无刷新的详细使用
showModalDialog参数传递和获
JS中showModalDialog 详细使用 基本介绍: showModalDialog() (IE 4+ 支持) showModelessDialog() (IE 5+ 支持) window.showModalDialog() 方法用来创建一个显示HTML内容的模态对话框。 window....
.txt 2.JavaScript的系统函数学习 .txt 3.js中用于对象的语句——with和for...in语句学习专题.txt 4.smallSoftkey小软键盘,大键盘 5.window.open参数详解 .txt 6.Window.ShowModalDialog使用详解 ...
ShowModalDialog函数的功能: 使用方法: 参数说明:
模态子画面详解 以及例程,转载与网络 希望能给大家提供帮助