I get these more often than not when I go to the home page and click Forums, and when I click Play Game, on both PC and Mobile. I haven't found much of a solution to preventing these so my best suggestion is to go with what Twisted said and DON'T CLICK ANYTHING on those pages, and make sure you have a good antivirus program. I use AVG and it's good.
One thing you could possibly try is to go into your computer's control panel and to programs, uninstall/change programs, and look for any unfamiliar programs that you don't recognize. Uninstall them cuz they could be adware or malware, and both will give you unnecessary ads on a lot of places you go to. Be careful tho, make sure those unfamiliar programs are not important for your computer to avoid uninstalling something you may actually need. Best way to do that is to look at the date it was installed, anything that matches the date you got your computer is important and should be left alone, but anything that doesn't match that date, and that you don't recall installing, should probably be looked into.
I'm rambling again so I'm gonna leave it at that.
EDIT: Sometimes I hate posting on mobile...