用window.showModalDialog打开一个页面就可以了。
把text当参数传进去。
页面里面有你要的东西,返回的时候把值赋给text.
把text当参数传进去。
页面里面有你要的东西,返回的时候把值赋给text.
解决方案 »
- 一个this问题
- 请问如果有个弹出层 我想第一次点击一个按钮让他显示 然后我点击非他的任何一个元素让他消失 当然点击它本身他不消失 用jquery或者js咋做
- 求段JS代码~关于文本域的简单问题!~在线等~
- 请帮忙看看这段javascript代码,谢谢。
- alert 弹出框问题
- 如何用JS使现保存整个网页(包括其中的图片,样式表等信息!)
- 一个小问题,熟悉DOM的朋友帮忙看看
- javascript问题请教.
- 如何利用一个页面关闭一个新的页面?
- js 动态添加成员变量
- 用一个正则表达式找出"{--....... --}"这一个字符
- iframe 问题! 一个页面中有两个层A、B,A层中包含iframeA,B层中包含iframeB,iframeB中嵌套iframeD,如何在iframeA中控制ifrmameD显示内容?
主界面:
<br><INPUT type="text" name=text1 >
<INPUT type="button" value="日期" name="pickDate" onclick="aaa(this);">
<br><INPUT type="text" name=text2>
<INPUT type="button" value="时间" name="pickTime" onclick="aaa(this);" >
<br><INPUT type="text" name=text3>
<INPUT type="button" value="时间日期" name="pickAll" onclick="aaa(this);"> <SCRIPT>
function aaa(obj)
{
var para="scroll:no;status:no;center:yes;unadorned:no;dialogHeight:215px;dialogWidth:"
switch (obj.name)
{
case "pickDate" :
//只选日期
para+="450px;";
case "pickTime" :
//只选时间
para+="200px;";
break;
case "pickAll" :
//全选
para+="450px;";
break;
}
window.showModalDialog("time.htm?" ,obj, para)}</SCRIPT>
文件二,时间选择器。
<HTML>
<HEAD>
<TITLE>时间选择器</TITLE>
<style>
body
{
margin-left: 0px;
margin-top: 10px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #d4d0c8;
}
input.txt
{
BORDER-TOP: lightgrey 1px solid;
BORDER-LEFT: lightgrey 1px solid;
BORDER-RIGHT:lightgrey 1px solid;
BORDER-BOTTOM: lightgrey 1px solid;
BACKGROUND-COLOR: #d4d0c8;
}
input.btn {
font-family: 宋体 Fixedsys;
font-size:12px;
BORDER-RIGHT: royalblue 1px solid;
BORDER-TOP: royalblue 1px solid;
BORDER-LEFT: royalblue 1px solid;
LINE-HEIGHT: 16px;
BORDER-BOTTOM: royalblue 1px solid;
HEIGHT: 18px;
BACKGROUND-COLOR: lightblue;
cursor:hand;
COLOR: royalblue;
}
body,td {
font-size: 12px;
}
.N
{
display:none;
}
.B
{
display:block;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></HEAD>
<BODY>
<table width="98%" height="170" border="1" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="270" id=tdDate >
<OBJECT id=C1 height=170 width=270 onMouseMove="setDate();"
classid=clsid:8E27C92B-1264-101C-8A2F-040224009C02><PARAM NAME="_Version" VALUE="524288"><PARAM NAME="_ExtentX" VALUE="7144"><PARAM NAME="_ExtentY" VALUE="4498"><PARAM NAME="_StockProps" VALUE="1"><PARAM NAME="BackColor" VALUE="-2147483633"><PARAM NAME="Year" VALUE="2004"><PARAM NAME="Month" VALUE="4"><PARAM NAME="Day" VALUE="28"><PARAM NAME="DayLength" VALUE="0"><PARAM NAME="MonthLength" VALUE="0"><PARAM NAME="DayFontColor" VALUE="0"><PARAM NAME="FirstDay" VALUE="1"><PARAM NAME="GridCellEffect" VALUE="1"><PARAM NAME="GridFontColor" VALUE="10485760"><PARAM NAME="GridLinesColor" VALUE="-2147483632"><PARAM NAME="ShowDateSelectors" VALUE="-1"><PARAM NAME="ShowDays" VALUE="-1"><PARAM NAME="ShowHorizontalGrid" VALUE="-1"><PARAM NAME="ShowTitle" VALUE="-1"><PARAM NAME="ShowVerticalGrid" VALUE="-1"><PARAM NAME="TitleFontColor" VALUE="10485760"><PARAM NAME="ValueIsNull" VALUE="0"></OBJECT></td><td width="180" align="center" valign="middle">
<table width="100%" border="0" cellpadding="0" cellspacing="0" id=tbTime>
<tr>
<td align="center" scope=row>系统时间 <span id=text1></span> </td>
</tr>
<tr>
<td align="center" scope=row>设置时间:</td>
</tr>
<tr>
<td align="center" scope=row><select id=s1 onchange="settime();"></select >点<select id=s2 onchange="settime();"></select>分<select id=s3 onchange="settime();"></select>秒</td>
</tr>
<tr>
<td align="center" scope=row><input id="text2" ></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="tbDate">
<tr>
<td align="center" scope="row">日期: <br>
<input id="text3"></td>
</tr>
</table>
<br>
<input type="button" onClick="rtn();" value="确定"></td>
</tr>
</table>
<br>
<br>
<SCRIPT>
switch (window.dialogArguments.name)
{
case "pickDate" :
tbTime.className ="N";
setDate();
break;
case "pickTime" :
tbDate.className ="N";
tdDate.className="N";
iniTime();
break;
case "pickAll" :
setDate();
iniTime();}
function iniTime()
{
text1.innerText=getMyTime();
addAll(s1,23);
addAll(s2,59);
addAll(s3,59);
d = new Date();
s1.selectedIndex=d.getHours();
s2.selectedIndex=d.getMinutes();
s3.selectedIndex=d.getSeconds();
window.setInterval("text1.innerText=getMyTime();","1000");
settime();
}
function getobj(obj)
{
for(i=1;i<obj.document.all.length;i++)
{
if(obj==obj.document.all(i))
{
return(obj.document.all(i-1))
}
}
}
function settime()
{
text2.value=s1.value+":"+s2.value+":"+s3.value;
}
function setDate()
{
if(text3.value != C1.Year + "-" + C1.Month + "-" + C1.Day)
{
text3.value=C1.Year + "-" + C1.Month + "-" + C1.Day;
}
}
function rtn(obj)
{
var r=new String("");
r=text3.value + " " + text2.value;
r=r.replace(/(^[\s]*)|([\s]*$)/g, "");
getobj(window.dialogArguments).value=r;
self.close();
}function getMyTime(){
var d, s = "";
var c = ":";
d = new Date();
s += d.getHours() + c;
s += d.getMinutes() + c;
s += d.getSeconds();
return(s) ;
}
function addAll(obj,n)
{
var ooo=document.createElement("<OPTION>");
for(i=0;i<=n;i++)
{
add(obj,i,i);
}
}
function add(obj,v,t)
{
var ooo=document.createElement("<OPTION>");
ooo.value=v;
ooo.text=t;
obj.add(ooo);
}
</SCRIPT>
</BODY>
</HTML>
演示
我忘记删除了,那东西是开发工具自己加的。
window.showModalDialog("time.htm?"+Math.random(),obj, para)
输入
regsvr32 MSCAL.OCX
有什么反应?是不是告诉你success?
再实验一下,ok?
安装时候采用克隆的办法或者光盘磨损都可能造成虽然安装成功,但是个别不重要的文件丢失。
还有某些游戏作弊程序也会修改系统时间相关的内容