I've done a bit of reading about this thing, and here's what I've found:
JavaScript has nothing to do with this; disabling it will simply cause a lot of sites to not work, and won't protect you anyway. Leave it alone and ignore the people advising you to disable it. Those doing the advising, please take the time to do some fact-checking before giving advice in the future.
Disabling your Java plugins in your browsers is all you need to do. Depending on your browsing habits, you might not even need to do that, but since proper computer security is indistinguishable from paranoia, I say just go ahead and disable it anyway. If you have the JRE or JDK installed for running programs and games outside your browser (Minecraft for example), you don't need to uninstall it. This only affects the browser plugin. Of course, any browser-based games that use Java will stop working with the plugin disabled, so if you have the option, download the games to your PC instead of running them in your browser.
If you'd prefer not to disable the Java plugins because you depend on them for work or school-related tasks, you can use NoScript on Firefox or its equivalent on other browsers. As its name implies, it will block JavaScript on pages you visit, but will also block Java, Flash, Acrobat, and other plugins as well until you specifically allow them to run for that site. I've used it for over a year and am very happy with it.
You could also just be careful which sites you go to, but I've learned that even sites you trust can occasionally display a banner ad with a malicious payload that will cause you all kinds of grief. Cracked, SomethingAwful, and IGN have all done this at some point, and I've since decided that being careful isn't enough on its own.
Also, if anyone's using IE, please go get Firefox or Chrome right now. Every time they come out with a new one, they say they've fixed their security problems and are as good as the others. And they're usually right, for a couple weeks at least. After that, IE and User Access Control will gleefully allow the installation of anything that asks nicely, and then UAC will do everything it can to protect that poor defenseless malware from your attempts to remove it. Yes, this shit happened to me, and I still scoff a bit whenever Microsoft utters a word about security.