Re: Why, $deity, why?!?!
I have terrible difficultly understanding how JavaScript became the defacto standard
I think, like many things Internet, it was largely an accident.
The tale seems to have blurred over time, but I think it went something along these lines. Netscape was looking at a scripting language. Brendan Eich was known to be a fan of Scheme (and Self), but Netscape wanted to partner with Sun as a bulwark against Microsoft's tentative Internet interest. Sun was keen to promote Java, but it wasn't at that point feasible (either because of the limitations of PCs at the time, or the short development window, or both). The compromise was that Netscape's scripting language would adopt a superficial similarity with Java syntax and borrow the Java name. Eich was able to knock something up in a fortnight.
Once Java was also incorporated into Netscape, it and JavaScript lived rather unhappily side by side for some time.
JavaScript would probably have died a death if it weren't (ironically) for Microsoft - who also offered VBscript in Internet Explorer - to come up with AJAX, initially as an ActiveX object. This, for the first time, offered scriptable dynamic updates to the document. Its popularity swiftly resulted in equivalent mechanisms in other browsers and a significantly wider use of JavaScript to access its functionality.
JavaScript persists even now because: (a) it is reasonably functionally complete (and has been from the outset), having borrowed just sufficient from languages such as Scheme and Self to make it widely applicable whilst having such a short initial implementation period; (b) it's sufficiently ubiquitous that it's been worth investing significant resources in ameliorating is various issues.
I think the concept is quite clever and was well-tailored to the requirement of the moment. As a programming mainstay, I am less convinced of its merits. There is a school of thought that it was actually a genius concept and that people who criticise JavaScript have simply failed to understand it - but in my view that's a retrospective construction mostly led by the kind of people who argue at length about the merits of composition versus derivation and who don't really want to accept that things that are widely used may just be the product of a short-term lash-up.