Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rakeshpai/1582088 to your computer and use it in GitHub Desktop.
Save rakeshpai/1582088 to your computer and use it in GitHub Desktop.
Better anonymous function compressed with Closure Compiler
// Note: Line breaks added for clarity
(function(a, b, c) {
/*
Your code here
Calls to window.whatever will become a.whatever
Similarly, document.whatever will be b.whatever, and c will be undefined
*/
}(window, document))
@JavaScript-Packer
Copy link

Here is a sample mixed with a check to make sure the page is ready:

function run(it){/in/(document.readyState)?setTimeout(run,99,it):it()}
run(function(a,b){a(b)}(eval,'alert("WHAK.com");'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment