JavaScript 如何弹出一个对话框窗口
//定义要打开的对话框页面的地址 一般用action跳转要写明action的地址,如果需要参数,则在后面拼接
var urlDialog = "grpBlackWhiteManageAction.do?act=choiceMessageModel&GrpBWhiteListLevel=0";
//定义要弹出的对话框的模式,dialogWidth宽,dialogHeight高 等等
var style = "dialogWidth=600px;dialogHeight=600px;status=yes;edge=sunken;help=no";
//定义一个变量来接受对话框的返回数据
var rv = window.showModalDialog(urlDialog,"",style);
//如果没有返回数据的话,就直接写
window.showModalDialog(urlDialog,"",style); 、
对话框页面的关闭按钮触发事件可以这样写
<input type="button" name="colse" value="关闭" onclick="javaScript:window.close();">
相关文档:
符合 XHTML 1.0 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> ......
内部数组
在Java中为了方便内部对象的操作,可以使用窗体(Forms)、框架(Frames)、元素(element)、链接(links)和锚(Anchors)数组实现对象的访问。
anchors[]:使用《A name=“anchorName“》标识来建立锚的链接。
links[]: 使用<A href=”URL”>来定义一个越文本链接项。
Forms[]: 在程序 ......
三种不同位置的JavaScript代码的写法
客户端脚本JavaScript在写法上其实有很多种方法,它们的放置位置也非常之多。。 下面列举在三种不同的地方写JavaScript代码,实现的效果都是点击按钮button弹出alert警告框
第一种是最常见的,代码如下 html代码
<input type="button" value="按钮1" id=" ......
原文:刘武|Javascript怎么在两个窗体之间传值
众所周知window.open() 函数可以用来打开一个新窗口,那么如何在子窗体中向父窗体传值呢,其实通过window.opener即可获取父窗体的引用。
如我们新建窗体FatherPage.htm:
XML-Code:
<script type="text/javascript">
function OpenChildWindow()
{ ......
<html>
<head>
<title></title>
</head>
<body>
<form id=aa name=aa>
<input type=button value="同意(10)" id=a1 disabled="disabled">
</form>
</body>
</html>
<script>
var num=10;
window.setTimeout("aa()",1000);
function ......