Jump to content

guleriahp

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by guleriahp

  1. thanx hacknsack, i'll try that.

    guleriahp,You can set a global variable and check it's state to execute your next code.
    <html><head>  <title></title><script type="text/javascript">var go_next = false;//variable for our check cyclevar tm = null;function checkCond(){var form = document.forms["f"];  if(form.elements["e1"].value.toLowerCase() == 'go'){     // next line clears the check cycle     clearInterval(tm);     go_next = true;     doForm(form);       }}function init(){tm = setInterval('checkCond()', 800);setTimeout('ckNext()', 1000);}function ckNext(){ if(go_next){   alert('Everything is complete..');   } else {   setTimeout('ckNext()', 1000);   }}function doForm(form){ form.elements["e2"].value = 'OK';}window.onload = init;</script>  </head><body><form name="f"> Go to start: <input type="text" name="e1"><br> Result: <input type="text" name="e2"></form></script></body></html>

    Get back to us if you have any questions.Thanks,

  2. I am using setInterval() function like this.fun2(){ return setInterval();}fun(){ interval = fun2(); -----some code------ ------some code-----}The problem is that when fun2() is called it is executing the fun2()... but by the side ----some code---- is also executed. what i want is, this '---some code--' must be executed only after execution of fun2() is over. plz suggest how can do that?

×
×
  • Create New...