Here's a (bad) javascript example that has locked up many a web browser.

file:javascript:while (true) {alert('this browser window will never see the light of day. mohahahha - Dr.Evil');}

Usually such code in adverts get pulled quickly.

Bob