In the past I had seen tools and plugins to completely stop any and all scripts from running, but this was a drastic fix, because on some sites and situations you might want to run scripts.
Is there a better solution? Yes. It’s a Firefox add-on called NoScript.
The add-on will block all scripts by default, but you can customize it extensively to make sure you’ll be able to run the scripts you need or want. For example, you can pre-define a list of domains that should be allowed to run scripts, or you can allow and disallow sites and pages on the fly, while you navigate.