[Question]
  [
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
 
 
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/12340/edit).
Closed 9 years ago.
[Improve this question](/posts/12340/edit) 
Sometimes people get frustrated on the StackExchange network (specifically SO).
![stackoverflow logo modified](https://i.stack.imgur.com/VWPZg.gif)
Your task is to create a bookmarklet that causes StackOverflow to explode/implode/destroy in some fashion. This will provide a nicer way of dispersing our frustrations.
The Rules:
* it must be in the form of a bookmarklet
* must work in Chrome and Firefox (latest stable)
* jQuery is on the site, so you can use it
* no creating a script tag that pulls explosionThisPage.js or similar
Scoring is the number of characters that need to be copied and pasted, except:
* -1 if you include an explanation
* -5 for each upvote
* -10 if you don't use jQuery
* -10 if it makes an explosion sound
* +9e72 if it actually does harm to the site (F5 should repair the damage)
If the gif's distracting, remove it.
  
[Answer]
Here's my entry, which I'll call **the drunkenator**:
```
javascript:void(setInterval(function(){c='1234567890poiuytrewqasdfghjklmnbvcxzZXCVBNMLKJHGFDSAQWERTYUIOP=)(/&%25$%23"!1';$(':not(iframe,script,style)').contents().each(function(){if(this.nodeType==3&&/\S/.test(this.nodeValue)){a=this.nodeValue.split('');x=0;for(i=0;i<a.length;i++){r=Math.random()*9999;if(r<10){x=1;j=c.indexOf(a[i]);a[i]=(r<4%3F(t=a[i-1],a[i-1]=a[i],t):r<5%3F'':r<6%3Fa[i]+a[i]:j<0%3Fa[i]:c.charAt(j+(r<8%3F1:-1)))}}if(x)this.nodeValue=a.join('')}})},100))
```
At 474 chars, it's probably not going to win any golf prizes, but I'm hoping to make up for it in upvotes. :)
Here's the same code de-obfuscated:
```
setInterval(function () {
  var c = '1234567890poiuytrewqasdfghjklmnbvcxzZXCVBNMLKJHGFDSAQWERTYUIOP=)(/&%$#"!1';
  $(':not(iframe,script,style)').contents().each(function () {
    if (this.nodeType==3 && /\S/.test(this.nodeValue)) {
      var a = this.nodeValue.split('');
      var x = 0;
      for (i = 0; i < a.length; i++) {
        r = Math.random() * 9999;
        if (r < 10) {
          x = 1;
          j = c.indexOf(a[i]);
          a[i] = ( r < 4 ? (t = a[i-1], a[i-1] = a[i], t)
                 : r < 5 ? ''
                 : r < 6 ? a[i] + a[i]
                 : j < 0 ? a[i] : c.charAt(j + (r < 8 ? 1 : -1)) ); 
        }
      }
      if (x) this.nodeValue = a.join('');
    }
  });
}, 100);
```
What it does is randomly mutate the text on the page, swapping adjacent characters, deleting or duplicating characters or replacing them with ones adjacent to them on the keyboard. The effect is kind of subtle at first, but leave it running for a while, and the page content will inevitably decay into a mess of drunken typing:
![Go home, SO, you're drunk!](https://i.stack.imgur.com/SUdJ1.png)
Ps. The code isn't in any way SO-specific, so it'll work on any website that uses jQuery. Try it on [Wikipedia](http://en.wikipedia.org) for hilarious results. The idea is based on something I wrote years ago as a creative interpretation of the "99 bottles of beer" challenge: my version introduced a slowly increasing number of typos into each verse, until the last ones were all but unrecognizable. If anyone wants to see it, [here's the original Perl code](https://groups.google.com/forum/message/raw?msg=comp.lang.perl.misc/f5KbGcDE6tw/LrM-Ho2NaoMJ).
[Answer]
Chicken!
### Score: 46 - 1 (explanation) - 5\*17 (votes) = -40
```
javascript:$('*:not(:has(*))').text('chicken')
```
It simply takes every element with no children and replaces it with the text `'chicken'`.
Sample screenshots:  
[more chicken](https://i.stack.imgur.com/RW7bE.png)  
[this question chickenified](https://i.stack.imgur.com/p2cyl.png)
![image](https://i.stack.imgur.com/BVYUb.png)
[Answer]
I don't know why this was downvoted, I like it :)
This isn't the shortest, but I think it's pretty:
**133 chars** -1
```
javascript:(function(){setInterval(function(){$("div, span").eq(Math.round(Math.random()*$("div, span").length)).hide(500)},90)}());
```
Ungolfed:
```
javascript:(function(){  
         window.setInterval(function() {
                 i = Math.round(Math.random() * $("div, span").length);
                 $("div, span").eq(i).hide("slow");
         } , 90);
}());
```
Explanation: I hope this counts, this script implodes the site instead of exploding it ;) This just picks a random div or span every 90ms and closes it slowly..
[Answer]
Because it was not defined if the higher or lower score wins...
```
javascript:$(".vote-down-off").click()
```
Base: 38  
Bonis:
* +9e72 Permanent damage.
### Final score: 9000000000000000000000000000000000000000000000000000000000000000000000038
Btw, I did not try it.
[Answer]
## My pupose 245 chars.
Mostly not the shorter, but I like it ;-)
```
javascript:document.body.innerHTML+='<img%20id="bigMsk"%20src="https://i.stack.imgur.com/VWPZg.gif">';document.getElementById('bigMsk').setAttribute('style','z-index:1;opacity:.6;display:block;position:fixed;top:0;left:0;width:100%;height:100%;');
```
-1: Explanation:
* I use the nice offered animated gif image from question,
* With the help of CSS, I put them over the page in full page, with a 60% opacity.
:
```
document.body.innerHTML+=
   '<img%20id="bigMsk"%20src="https://i.stack.imgur.com/VWPZg.gif">';
document.getElementById('bigMsk').setAttribute('style',
    'z-index:1;
     opacity:.6;
     display:block;
     position:fixed;
     top:0;
     left:0;
     width:100%;
     height:100%;
');
```
Mostly readable by itself ;-)
-10 No JQuery
### Alternative:
There is an alternative:
```
javascript:document.body.innerHTML+='<img%20id="bigMsk"%20src="https://i.stack.imgur.com/aTtWM.gif">';document.getElementById('bigMsk').setAttribute('style','z-index:1;opacity:.6;display:block;position:fixed;top:0;left:0;width:100%;height:100%;');
```
Based on unmodified GIF, found at [Wikimedia Commons: File:Animated fire by nevit.gif](http://commons.wikimedia.org/wiki/File:Animated_fire_by_nevit.gif)
**Image:** ![Image from Wikipedia](https://i.stack.imgur.com/aTtWM.gif)
### Sample:
![enter image description here](https://i.stack.imgur.com/ACvDH.png)
[Answer]
Ok, I think this should meed the criteria:
```
javascript:document.write("<h1>Exploded</h1>")
```
Replaces the current page with "Exploded"
Score: 46  
-1 Explaination  
-10 No jQuery 
## 35
[Answer]
This one's enjoyable, and causes quite a bit of lag too :D
```
javascript:setInterval(function(){document.body.innerHTML=document.body.innerHTML.replace(/\d+/g,function(){return Math.random()*100|0});},500)
```
It just sets an interval that replaces all strings of digits with a random number from 0 to 100. Twice per second. It creates a bunch of errors, as you might expect, and I could fix it to stop all the 404s when image URLs are changed, but I think it's more fun this way and it's code golf. :D
Score:
* 132 base
* -1 explanation
* -5 upvote
* -10 no jQuery
Total score: 116
[Answer]
# 165 chars (164 points)
-1 for explaination
Here's my attempt. It's not particularly short, but it's fun.
```
javascript:r=Math.random;$("a,span,p").each(function(){var a=$(this);a.css({position:"relative"});a.delay(1E4*r()).animate({left:9E3*r()-4E3,top:9E3*r()-4E3},555)});
```
It slides individual elements off the page in random directions. I specifically included span because of the syntax highlighting (each color has a separate span). 
```
r = Math.random;
$('a,span,p').each(function () {
    var t = $(this);
    t.css({
        position: 'relative'
    });
    t.delay(r()*10000).animate({
        left: r() * 9e3 - 4e3,
        top: r() * 9e3 - 4e3
    }, 555);
});
```
It of course could be shortened by removing some of the tags, but let me know if there are any ways to shorten it without reducing the performance.
[Answer]
# *181* 151 chars - 1 (explanation) - 10 (no jQuery) = 140 points
```
javascript:i=setInterval(function(){for(var a=document;0!==a.childNodes.length;)a=a.childNodes[a.childNodes.length-1];a!==document?a.parentNode.removeChild(a):clearInterval(i)},50);
```
A few more characters can be saved by omiting the `function(){` and using a string instead. Also note the extraction of commonly used properties, e.g., `c='childNodes` allows us to do `z[c]` instead of `z.childNodes`.
```
javascript:h=setInterval('d=z=document;c="childNodes";for(l="length";z[c][l];z=z[c][z[c][l]-1]);z!=d?z.parentNode.removeChild(z):clearInterval(h)',50);
```
I guess I could make less points by using jQuery and not traversing properties, but oh well.
**Ungolfed:**
```
var intervalHandle = setInterval(function() {
    var lastElement = document;
    //get last element
    while (lastElement.childNodes.length !== 0) {
        lastElement = lastElement.childNodes[lastElement.childNodes.length - 1];
    }
    if(lastElement !== document) {
        lastElement.parentNode.removeChild(lastElement);
    } else {
        clearInterval(intervalHandle);
    }
}, 50);
```
Basically this finds the latest DOM element on the page and removes it. Then keeps doing that for every 50 milliseconds, which I found to be a kind-of-average nice speed to see a page getting ripped from the ground up. It's therapeutic, I swear it.
Disclaimer: I had made this some time ago and decided to share it, since it seems appropriate here. The source is at [my GitHub repository](https://github.com/AlphaGit/random-javascript/blob/master/destroy-me/destroyme.js).
[Answer]
### Javascript, 281
```
javascript:$('body').html().split('<code>javascript:').forEach(function (a) {if (a.indexOf("location")*a.indexOf("write")*a.indexOf("noscript")==-1) try{exec(a.split("</code>")[0].replace(/&#(\d+)/g, function(match, dec) {return String.fromCharCode(dec);}))} catch (e) {}});void 0;
```
It gets every response to the question in the form of `<code>javascript:(stuff)</code>` that doesn't change the location, and runs all of them.
[Answer]
I like this effect. It basically toggles a slide effect for every div on the site every 1 millisecond.
```
javascript:setInterval(function(){$('div').toggle()},1)
```
**Score**
```
56
-1 Explanation
--------------
55 Total
```
]