Guest User

Untitled

a guest
Jan 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. /*
  2. * concise, but cryptic for the first two minutes you see this
  3. */
  4. (function ($) {
  5.  
  6. $(selector).each(function () {
  7. // code
  8. });
  9.  
  10. $(selector).each(function () {
  11. // code
  12. });
  13.  
  14. $(selector).each(function () {
  15. // code
  16. });
  17.  
  18. })(jQuery);
  19.  
  20.  
  21. /*
  22. * clunky pollution of global namespace
  23. */
  24. var fakeMeaninglessNamespacingFunction = function() {
  25. var $ = jQuery;
  26.  
  27. $(selector).each(function () {
  28. // code
  29. });
  30.  
  31. $(selector).each(function () {
  32. // code
  33. });
  34.  
  35. $(selector).each(function () {
  36. // code
  37. });
  38.  
  39. }
  40.  
  41. fakeMeaninglessNamespacingFunction();
Add Comment
Please, Sign In to add comment