JavaScript is just a language. It can (and should) do what the platform
allows.
Which would be fine, except its platform is EXPLICITLY "any computer
system using the Javascript process engine". In other words, it has to
rely on an use NONE of the OS-specific or hardware-specific features
of ANY particular system.
Hence it cannot and SHOULD NOT be able to use a DLL under Windows.
Client-side JavaScript can very well instantiate ActiveX DLLs in
platforms allowing it (IE) and in relaxed security environments. There
is nothing wrong with that.
That is a feature of the IE version of the Javascript engine. It
happens also to be allowed on the Mozilla engine (whose name I can't
recall offhand, but has something to do with monkeys) so is available
in Netscape, Mozilla, Firebird and so on.
Provided, of course, they are running on Windows. It is an ADDED
feature and not a STANDARD feature - and indeed has been the cause of
much argument during development since, strictly speaking, it should
not be allowed but has very good uses for compatibility.