ajax - How can I run a vb function every minute in jquery -


My question is simple, how can I set a timer to run and execute a function in jquery ?

For example, for example, I want a vb function to execute every minute. How do I do it in jquery?

The following code executes the function once. How do I want to execute it every minute?

  $ (window) .load (function () {$ .ajax ({type: "POST", url: "Default.aspx / CheckPending", data: '{}', ContentType : "Application / Jason; Charset = UTF-8", Datatype: "Jason", Success: Alert ("Success"), Error: Warning ("Error")}}});   < / Div> 

It runs only once because you run it on the window.load event.

To run more frequently than this, use this function.

  window.setInterval ("JavaScript function", milliseconds);   

In this case:

  $ (vs Do) .load (function () {window.setInterval ($ .ajax ({type: "POST", Url: "Default.aspx / CheckPending", data: '{}', contentType: "application / json; charset = "Utf-8", data type: "json", success: alert ("success"), error: alert ("error")}), 60000);});    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -