Guest User

Untitled

a guest
Apr 29th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment