Malware, such as computer viruses and spyware, can be accidentally installed from malicious websites using ActiveX controls (drive-by downloads). Signed Java applets can also be used for such attacks, although this is rare.
ActiveX controls — small program building blocks — can serve to create distributed applications that work over the Internet through web browsers. Examples include customized applications for gathering data, viewing certain kinds of files, and displaying animation.
One can compare ActiveX controls in some sense to Java applets: programmers designed both of these mechanisms so that web browsers could download and execute them. However, they also differ: