Javascript support varies widely from browser to browser. MS (probably intentionally) didn't quite do the same thing that Netscape did. But Javascript never really had a definition other then 'do what Netscape does' and since the different versions of Netscape varied in some basic details things are all over the place.
And both implementations have significant flaws that you just have to work around.
The only thing to do is learn what works and what doesn't by trial and error and test everything in every browser that you support.
Or you can avoid doing anything to exotic. You can avoid a lot of problems by keeping each page simple and not trying to force the browser to be something it isn't.
Jay