Language/JavaScript2008.04.14 01:35

<부모 창>

<html><body><form name="form1">
<input type='hidden' name='click'>

<input type="text" name="sTime" value="">
     <input type="button" name="stimer" value="StartTime" onclick="go_time(this.value)"> ~ <br>
<input type="text" name="eTime" value="">
     <input type="button" name="etimer" value="EndTime" onclick="go_time(this.value)">

</form></body></html>

<SCRIPT>
function go_time(arg)
 {
  if (arg == "StartTime") {
   document.form1.click.value="s";
  } else if (arg == "EndTime") {
   document.form1.click.value="e";
  }

  var url = "setTime.jsp";
  var name = "End_Time";
  var features = "width=580px, height=160px, left=0px, top=0px, toolbar=no, menubar=no, location=no, scollbars=yes, status=no, resizable=no, fullscreen=no";
  window.open(url,name,features);
 }
</SCRIPT>


<팝업 창>

var arg = opener.document.form1.click.value;

function redir()
{
 sdate = "aaa";
 if(arg=="s"){
  opener.document.form1.sTime.value = sdate;

  window.close();
 }else if(arg=="e"){
  opener.document.form1.eTime.value = sdate;

  window.close();
 }
}

Posted by 깜점