Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are javascript programs delivered in plain text?

Why was it decided to ship javascript programs in plain text? Was it to achieve performance enhancement or the authors never imagined that javascript will be used in much more complex applications and developers may want to protect the source code?

like image 882
dsr Avatar asked May 15 '26 14:05

dsr


2 Answers

I think part of the reason was that since HTML itself was delivered in plain text to the browser then so should JavaScript. It was the way of the Web.

like image 136
Darrell Brogdon Avatar answered May 18 '26 04:05

Darrell Brogdon


That's because JavaScript was never intended for large web applications, rather it was a way to do something "cool" on the browser. JavaScript wasn't a very popular language and was despised until the advent of AJAX, that is why there has never been much insight how JavaScript should be distributed. After all, simplest way to send JavaScript to a browser was through regular text files, why would they have bothered with anything else back in 1995?

like image 25
Tatu Ulmanen Avatar answered May 18 '26 05:05

Tatu Ulmanen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!