易截截图软件、单文件、免安装、纯绿色、仅160KB

使用javascript打开模态对话框

1. 标准的方法
<mce:script type="text/javascript"><!--

function openWin(src, width, height, showScroll){
window.showModalDialog (src,"","location:No;status:No;help:No;dialogWidth:"+width+";dialogHeight:"+height+";scroll:"+showScroll+";");
}
// --></mce:script>  
例:<span style="CURSOR: pointer" onclick="openWin  
(’http://www.deepteach.com’, ’500px’, ’400px’, ’no’)">点击</span> 
2. 要注意的是,Firefox并不支持该功能,它支持的语法是
window.open  
(’openwin.html’,'newWin’, 'modal=yes, width=200,height=200,resizable=no, scrollbars=no’ ); 
3. 如何自动判断浏览器
<input type="button" value="打开对话框" onclick="showDialog('#')"/>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showDialog(url)
{
if( document.all ) //IE
{
feature="dialogWidth:300px;dialogHeight:200px;status:no;help:no";
window.showModalDialog(url,null,feature);
}
else
{
//modelessDialog可以将modal换成dialog=yes
feature ="width=300,height=200,menubar=no,toolbar=no,location=no,";
feature+="scrollbars=no,status=no,modal=yes";
window.open(url,null,feature);
}
}
//-->
</SCRIPT> 
4. 如何在页面之间传递数值
(一)showModalDialog使用例子,父窗口向子窗口传递值,子窗口设置父窗口的值,子窗口关闭的时候返回值到父窗口.
farther.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>New Document </TITLE>
<META content="EditPlus" name="Generator">
<META content="" name="Author">
<META content="" name="Keywords">
<META content="" name="Description">
<mce:script language="javascript"><!--
function openChild(){
var k = window.showModalDialog("child.html",window,"dialogWidth:335px;status:no;dialogHeight:300px");
if(k


相关文档:

JavaScript replace() 方法

 
定义和用法
replace() 方法用于在字符串中用一些字符替换另一些字符,或替换一个与正则表达式匹配的子串。
语法
stringObject.replace(regexp,replacement)
参数
描述

regexp
必需。规定了要替换的模式的 RegExp 对象。请注意,如果该值是一个字符串,则将它作为要检索的直接量文本模式,而不是首先 ......

JavaScript控制CheckBoxList单选两种方法

方法1:
 1function   CheckSelect()
 2 {  
 3    var tb = document.getElementById("ctl00_ContentPlaceHolder1_chkYear"); 
 4
 5    for(var i=0;i < tb.rows.length;i+ ......

javascript中Date和string的互转

js是弱类型的 但是某些时候 你还真需要一个date
比如说 指定时间 那么3个小时后是什么时间
这样的函数 自己写就麻烦了
转成Date
var hs = Date.parse('03/02/2009 22:10');
 var d = new Date(hs);
 document.write(d);
 
 document.write('<br/>');
 var h=3.5;
 var arrh= ......

Javascript怎么在两个窗体之间传值

原文:刘武|Javascript怎么在两个窗体之间传值  
众所周知window.open() 函数可以用来打开一个新窗口,那么如何在子窗体中向父窗体传值呢,其实通过window.opener即可获取父窗体的引用。
如我们新建窗体FatherPage.htm:
XML-Code:
<script type="text/javascript">
function OpenChildWindow()
{ ......

javascript实现对文件上传类型的限制

注: http://www.java114.com/277/content4355.html
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> upload </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号