daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest May 16th, 2018 111 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. window.onload = function()
  2. {
  3.   var
  4.   body = document.getElementsByTagName('body')[0],
  5.   div  = document.createElement('div'),
  6.   parentDiv, childDiv;
  7.   for ( i = 0; i < 5000; i++ )
  8.   {
  9.     parentDiv = div.cloneNode(true);
  10.     parentDiv.onclick = foo;
  11.     childDiv  = div.cloneNode(true);
  12.     childDiv.onclick = bar;
  13.  
  14.     // Doesn't Leak
  15.     body.appendChild(parentDiv);
  16.     parentDiv.appendChild(childDiv);
  17.     body.removeChild(parentDiv);
  18.     parentDiv.removeChild(childDiv);
  19.     parentDiv = null;
  20.     childDiv = null;
  21.   }
  22.   body = null;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top