Google Chrome is really good about pop ups support.google.com/chrome/bin/answer.py?hl=en&answer=95472 - Lil Josh liljosh.com web developer
What people suggested up until now is on the user side and won't work if you want to iframe a site that pops an alert. I think proxy sites cache the page and serves with the parts like javascript cut out.
noscript a plugin for mozilla firefox or google chrome is the best way to start out with a blacklists all sites and then start to allow scripts for domain names you trust slowly building a whitelists noscript is also a great tool for preventing a lot of malware from executing... you can click on bitly links etc and go wherever you want on the net as long as a sites still blacklisted javascripits disabled