A script is a program or set of commands carried out by another program rather than by a computer processor.
Think of a script as a short application that runs inside another application.
While the web is the environment where most users encounter scripts on a daily basis, they are also used in many other environments. If you've integrated any web-based services on your computer, such as adding a Google Drive folder to your computer, then you've seen another implementation of a script.
Frequently Asked Questions
How are a script and an application different?
Applications are stand-alone software products that can be used independently of other applications to perform a wide range of functions. For example, Microsoft Outlook is a full-blown productivity application with e-mail at its core. MailWasher, on the other hand, is a focused script you can download and install that helps protect your Outlook inbox from malicious emails and spam. Without Outlook or another compatible email application, the MailWasher script is useless. It is only useful when attached to, and used within, a supported email application.
It's worth pointing out that the line between scripts and applications is quite blurry and not everyone agrees that a distinction should even be made between the two. Looking forward, the trend is for programs to be designed for greater and greater integration through the use of Application Programming Interfaces (API). As more and more applications integrate, it becomes increasingly difficult to differentiate scripts from applications.
How are scripts used by websites?
Scripts can be used to do many different things on a website. Some of the things commonly accomplished by scripts include tracking website visitors to generate visitor statistics, powering of interactive website features such as shopping carts, and testing of visitor browser capabilities to render the website most effectively.
Are website scripts dangerous?
Scripts aren't dangerous in-and-of themselves. However, if a browser has a security hole that hasn't been patched, scripts can be used by hackers to exploit that vulnerability. Keep in mind, that this can only happen if you visit a site that a hacker might be using. In other words, if you practice safe browsing, you don't need to worry about malicious scripts.