test.html

来自「一个日期控件,实现了日期的录入」· HTML 代码 · 共 43 行

HTML
43
字号
<html>
<head>
<title>test</title> 
<script type="text/javascript" language="JavaScript">
  <!--
var inputName;
  function myTest(inName)
  {
   var newHtml = null;
var a = window.screenTop+123-29;
var b = window.screenLeft + document.body.scrollWidth/2 - 95;

   if(newHtml==null)
{
newHtml = window.open("dataSend.html","abc","top="+a+",left="+b+",width=190,height=200,menubar=no,status=no,scrollbars=no,resizable=no,toolbar=no,location=no");//弹出一个新网页
this.blur();//失去焦点,如果不失去焦点会一直弹出页面

inputName=inName.name;//这个比较关键,inName是传过来的this指针,this指针不是与生俱来的志向调用者,是通过传参数的形势过来的
}
  }
  function myTest2(sendDataTime)
  {
window.document.all(inputName).value=sendDataTime;//这个也很重要,all(是指向name属性的,根据name属性来对其操作)
        //这么做的好处是可以根据不同的调用者来赋给不同调用者值
  }

  // -->
</script>
  </head>
  
  <body>
  <br>
<table>
  <tr>
    <td  class="tdbgcolorqueryright">开始时间</td>
    <td class="tdbgcolorqueryleft"><input name="beginDate" type="text" onFocus="myTest(this)" readonly="readonly"></td>
    <td  class="tdbgcolorqueryright">结束时间</td>
    <td class="tdbgcolorqueryleft"><input type="text" name="endDate" value="" onFocus="myTest(this)" readonly="readonly"></td>
  </tr>
</table>

  </body> 
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?