Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.81 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Javascript out function
  2. function foo(arg, ajaxcomplete) {
  3.     $.ajax({
  4.     //ajaxcall...
  5.     success: function() {
  6.         //set ajaxcomplete to true
  7.     }
  8. }
  9.        
  10. function foo(arg, ajaxcomplete) {
  11.         $.ajax({
  12.             success: function() {
  13.                 alert('O.K.');
  14.             },
  15.             complete: function(){
  16.                 alert('We are done');
  17.             }
  18.         });
  19.     }
  20.        
  21. function foo(arg, ajaxcomplete) {
  22.   $.ajax({
  23.     //ajaxcall...
  24.     complete: function() {
  25.       ajaxcomplete();
  26.       // Some other code here if required
  27.     }
  28.   }
  29.        
  30. var isComplete = false;
  31. foo('someArg', function() { isComplete = true; });
  32.        
  33. function foo(arg, ajaxcomplete) {
  34.     $.ajax({
  35.     //ajaxcall...
  36.     success: function() {
  37.  
  38.     },
  39.     complete: function(){
  40.         //set ajaxcomplete to true here
  41.     }
  42. }