You can test your code in Spidermonkey or Rhino (an older JS interpreter in Java), but you really donβt know which browsers it works in until you check your scripts in them!
I agree with the earlier poster, using a browser-independent library like jQuery is probably a good idea.
I did not use Spidermonkey, but I know that Rhino has a good graphical interface for debugging, which allows in the usual way: set breakpoints, clocks and go through the code.
source share