DoubleClickCheck

DoubleClickCheck.js

 

var errMsg='请等待处理完成。';
function isDoubleClick(){
 return (window.parent.RightFrm.document.readyState != null &&
  window.parent.RightFrm.document.readyState != 'complete') ||
     (window.parent.LeftFrm.document.readyState != null &&
  window.parent.LeftFrm.document.readyState != 'complete');
}

function isParentDoubleClick(){
 return (window.parent.parent.RightFrm.document.readyState != null &&
  window.parent.parent.RightFrm.document.readyState != 'complete') ||
     (window.parent.parent.LeftFrm.document.readyState != null &&
  window.parent.parent.LeftFrm.document.readyState != 'complete');
}

function isOpenerDoubleClick(){
 return (window.opener.parent.parent.RightFrm.document.readyState != null &&
  window.opener.parent.parent.RightFrm.document.readyState != 'complete') ||
     (window.opener.parent.parent.LeftFrm.document.readyState != null &&
  window.opener.parent.parent.LeftFrm.document.readyState != 'complete');
}
 

 

 

javascript里调用方法

 

function onDateClick(scrid,ymd){
 if (isDoubleClick()){
  alert(errMsg);
 }else{
  //alert("onDateClick["+scrid+"]["+ymd+"]");
  document.mnfrm.scr_id.value=scrid;
  document.mnfrm.inputdate.value=ymd;
  document.mnfrm.target="RightFrm";
      document.mnfrm.submit();
 }
}

 

if (isParentDoubleClick()){ alert(errMsg);return;}

 

jsp里的写法

<<

 

 

 

 

你可能感兴趣的:(function,javascript,null,jsp,class,path)