Yea it's quite annoying. Keep in mind that it's really easy to get malware from a lot of the websites. You jsut have to be careful with the links you click. As a pervious poster said, a lot of the times the "x" on a popup can be actually a prompt to install the malware. Altough there are
some decent ways to protect yourself from malware.
Overall, a lot of it has to do with using common sense when browsing the web. Having a good piece of software like in the link above can help, however it can also slow down your browsing experience.