The implementation of JS timed call method after successful and stop calling

Source: Internet
Author: User

  This article mainly introduces the success of JS timed call method and stop the implementation of the call, the need for friends can refer to the following

  Code is as follows: <pre name= "code" class= "JavaScript" ><pre name= "code" class= "JavaScript" > <span style= " Color:rgb (58, 62, 67); Font-family: ' Segoe ui Semibold ', ' Segoe UI ', ' Lucida Grande ', Verdana, Arial, Helvetica, Sans-serif; font-size:22px; line-height:27px; ">getresult is also available in. NET, and if used with. NET, it will produce an error that cannot be invoked." </span></pre> so the following GetResult () JS method name to be changed to another name, so as not to create other ambiguity!   <pre></pre>  <pre name= "code" class= "JavaScript" > </pre><pre name= "Code" class = "JavaScript" ></pre><pre name= "code" class= "JavaScript" >//timed refresh flag   var refreshid= "";//Note defined as global variable   function Felsh () { //alert ("Timed call method Start");  Refreshid=setinterval (getresult,1000); } // Invoked method     function GetResult () {  try{  var str=addfunctionname ();//unsuccessful return 1  if (str== "1") {   Return str; }  clearinterval (Refreshid);//Clear Timer service  }catch (e) {  alert (' Exception: ' + E.description); or alert (' Exception: ' +this.print (e));The advantage is that you can print out the wrong typing  }  return ""; }  function Addfunctionname () {  "1"; }</pre ><br>  <br>  <pre></pre>  <pre name= "code" class= "JavaScript" > </ pre><br>  <pre></pre>    </pre>   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.