Guest User

Untitled

a guest
Jun 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. $(document).ready(function() {
  2. ...stuffs...
  3. myFunction(par1, par2, anotherFucntion_callback);
  4. }
  5. );
  6.  
  7. function anotherFunction_callback(data) {
  8. ..stuffs..
  9. }
  10.  
  11. myFunction(par1, par2, anotherFunction_callback);
  12.  
  13. var temp = function() { anotherFunction_callback(data) };
  14.  
  15. function temp() { myFunction_callback(data) };
  16. // even though this looks just like a free function,
  17. // you still define it inside the ready(function())
  18. // that's why I call it "alternative". They are equivalent.
  19.  
  20. $(document).ready(function() {});
Add Comment
Please, Sign In to add comment