Be a Jerk. Use Javascript to Disable Your Website Visitor's Back Button

by peter_schlamp in Circuits > Websites

171 Views, 0 Favorites, 0 Comments

Be a Jerk. Use Javascript to Disable Your Website Visitor's Back Button

Screen+shot+2010-12-15+at+12.06.00+PM.png
Screen+shot+2010-12-15+at+12.06.00+PM.png
Javascript has a little know property called location.hash that can be "mis"used to disable the browser back button. In this Instructable, I will show you how to accomplish this and be a jerk just like me.

And the Code...

Screen+shot+2010-12-15+at+12.06.00+PM.png
Add the below to any webpage, then try your back button.
<script>
  i=0;
  while(i<100){
     location.hash = i;
     i++;
  }
</script>

You can try it here too by replacing what's in your browser address bar with:
javascript: i=0;while(i<100){location.hash = i;i++;}void(0);

Fun right? Now go out and be jerk.