Posted By

f on 03/29/11


Tagged


Versions (?)

bookmarklet pattern


 / Published in: JavaScript
 

Compiled with Closure Compiler: (function(a){var b=arguments.callee;if(this==window)return a&&b.call(a),b})();

  1. /**
  2.  * 1. Running as an anonymous function without arguments,
  3.  * return an function.
  4.  *
  5.  * 2. Running as an anonymous function with an argument,
  6.  * do something to the argument as being a method of the argument.
  7.  *
  8.  * 3. Running as an method,
  9.  * do something.
  10.  */
  11. javascript:(function(instance)
  12. {
  13. var ee = arguments.callee;
  14. if (this == window)
  15. {
  16. if (instance)
  17. ee.call(instance);
  18. return ee;
  19. }
  20. // <body> //
  21. // </body> //
  22. })();

Report this snippet  

You need to login to post a comment.