-2
 $(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#revocation" ).dialog({
  autoOpen: false,
  height: 200,
  width: 460,
  modal: true,
  buttons:{
    "Yes": function() {
      revocation();
    },
    "Close" : function() {
      $( this ).dialog( "close" );
    }
  }
});

I want to put add processing time in this function, when I click the button "Yes", add processing time of 3-5 seconds, thank you in advance

ThisClark
  • 14,352
  • 10
  • 69
  • 100
Alvin Boo
  • 1
  • 2
  • 1
    The [tag:processing] tag should only be used for questions about the Processing language. – Kevin Workman Mar 30 '15 at 15:05
  • when i click button "Yes" , in function revocation can add time slow or not ? – Alvin Boo Mar 30 '15 at 15:56
  • I think what you are really asking is how to add a time delay to a function so you can emulate processing time. See this post - [How to set time delay in javascript](http://stackoverflow.com/questions/17883692/how-to-set-time-delay-in-javascript) – ThisClark Mar 30 '15 at 18:13
  • you see my picture for more ,can add function , when i click button " yes " appear 2 files "revocation" in chrome with latency time: 410ms & 309ms , there a way to add jquery make one click button 2 file to run equal not, eg: 410ms & 410ms. ( http://i.stack.imgur.com/HUDaC.jpg ) thank you – Alvin Boo Mar 31 '15 at 18:34
  • can you show full listing? – takayoshi Mar 31 '15 at 18:48
  • I've updated, please help me – Alvin Boo Apr 03 '15 at 12:01

2 Answers2

0

Javascript is asynchronyous language. You can put

setTimeout(function() {revocation();},3000);

instead of

revocation();

for delay in 3000 msec

takayoshi
  • 2,789
  • 5
  • 36
  • 56
0

you see my picture for more ,can add function , when i click button " yes " appear 2 files "revocation" in chrome with latency time: 410ms & 309ms , there a way to add jquery make one click button 2 file to run equal not, eg: 410ms & 410ms.

Images

Alvin Boo
  • 1
  • 2