When JavaScript was developed back in 1995, it was originally just a «hack» to make websites more dynamic. Like usual with cool new things, developers started using its new dynamic capabilities. The sudden worldwide spread made defining a standard difficult, and the language got into disrepute.
With a big initiative all about HTML5 and CSS3, the standard has been improved by now. Now, JavaScript is running on almost every website and device on this planet. Not bad for a hack!