Go here if you didn't save the Java 1.4.2 update package and download it, then double-click the .pkg or .mpkg file to install Java. Follow the instructions Installer gives you. Once installation is completed (and you've restarted your Mac), repair permissions (open Disk Utility, select Mac OS X disk, click Repair Permissions).
Note that Java and Javascrupt are totally unrelated. Javascript was simply a marketting move to try and get some free mindshare from Java. Installing or updating Java will have no effect on Javascript.