0
function showEmp(){ 
      if(validate())
          {
          for(var i=0; i < document.employee.puid.length; i++){
              if(document.employee.puid[i].checked){
                  var emp_value = document.employee.puid[i].value;
              }
          }
          xmlHttp=GetXmlHttpObject();
          if(xmlHttp==null){
              alert ("Browser does not support HTTP Request")
                  return
          }
              var url="getPatient.jsp"
              url=url+"?emp_id="+emp_value;
              xmlHttp.onreadystatechange=stateChanged
                          xmlHttp.open("GET",url,true)
              xmlHttp.send(null)
      }
  }
  function stateChanged()
  {   
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
    { 
          var showdata = xmlHttp.responseText;
              alert(showdata)
          var strar = trim(showdata).split(":");
          if(strar.length>0)
                  {
              window.opener.location.reload();
              window.location.reload(); 
              opener.document.getElementById("puid").value=strar[1];
              opener.document.getElementById("fname").value=strar[2];
                          window.close();
          }
      }
  }

親ウィンドウのフィールドに値を表示できません。この変数ではshowdata=xmlHttp.responseText; ここでalert(showdata)showdataのアラートを保持していても、空のアラートボックスしか表示されていません。

4

1 に答える 1

0

多くのセミコロンが欠落しているようです。それはある種の「コピー/貼り付け」の間違いですか?

于 2012-06-29T11:41:29.767 に答える