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();">
相关文档:
1、判断是否为年月日时间格式
<script>
//去除字符串首尾空格
String.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
//验证是否为日期
function validator(){
if(isDate(document.all.demo1.value.trim())==false){
&n ......
内部数组
在Java中为了方便内部对象的操作,可以使用窗体(Forms)、框架(Frames)、元素(element)、链接(links)和锚(Anchors)数组实现对象的访问。
anchors[]:使用《A name=“anchorName“》标识来建立锚的链接。
links[]: 使用<A href=”URL”>来定义一个越文本链接项。
Forms[]: 在程序 ......
innerText是ie的私有属性,firefox的类似属性为textContent,如果在网页中使用innerText的话,需要用一个条件判断来查看浏览器支持哪种属性。这里我们可以为firefox定义一个innerText使得在正文代码中只需要用innerText而非一个函数,可使代码变得更直观简洁。
var lBrowser = {};
lBrowser.agt = navigator.userAgent.t ......
方法1:
1function CheckSelect()
2 {
3 var tb = document.getElementById("ctl00_ContentPlaceHolder1_chkYear");
4
5 for(var i=0;i < tb.rows.length;i+ ......