JavaScript alongside CSS and HTML is one of the main technologies of the global network. Since its creation, JavaScript has undergone great growth. In 1995 Netscape decided to add a scripting language to Navigator so the web pages won’t be static anymore. They collaborated with Sun Microsystems to embed the Java programming language, while also hiring Brendan Eich to embed the Scheme language.

In November 1996, JavaScript was submitted to ECMA International. The official release of the first ECMAScript language specification in June 1997.  Today JavaScript is no longer limited to the client-side – it is an increasingly popular choice for server-side tools and scripts and is entering the CDN layer thanks to edge computing solutions.

On its 25th birthday (4th of December 2020), JavaScript is one of the most popular programming languages.

According to experts, the script element is the 6th most popular HTML element in use. We spend around 14 times as many bytes on it as we do on HTML and 6 times as many bytes as CSS. The median site sends 444 KB of JavaScript when loaded on a desktop device, and slightly fewer (411 KB) to a mobile device.

 

Source: almanac.httparchive.org

The trend also seems to be in favor of using more JavaScript, not less. In comparison, last year, at the median we saw 13.4% less in JavaScript as tested on a desktop device, and 14.4% less in the amount of JavaScript sent to a mobile device.

 

Source: almanac.httparchive.org

Source: almanac.httparchive.org

 

But if we look at how much of that JavaScript is unused on any given page load, we see that the median page is shipping 152 KB of unused JavaScript. This means about 37% of the total script size that we send down to mobile devices is unused.

One of the trends that contribute to the increase in JavaScript usage is the ever-increasing amount of third-party scripts that get added to pages to help with everything from client-side A/B testing and analytics, to serving ads and handling personalization.

According to experts’ analysis, 9 scripts per page are first-party, compared to 10 per page from third-parties. The more scripts a site serves in the total, the more likely it is that the majority of those scripts are from third-party sources. The median site sends 147 KB of JavaScript from to first-parties desktop devices, compared to  267 KB from third-parties. The situation is very similar on mobile.

The browser pauses parsing of the HTML, when it discovers a script element, until the script has been downloaded, parsed, and executed. That significantly slows the render of pages.

As with all text-based resources on the web, developers save a huge number of bytes through minimization and compression. 85% of all JavaScript requests have some level of network compression applied.

The more JavaScript is used for sites and applications, the more demand for open-source libraries and frameworks to help with improving developer productivity and overall code maintainability. Sites that don’t use these tools are the minority on today’s web—jQuery alone is found on nearly 85% of the mobile pages tracked by HTTP Archive.

 

Source: almanac.httparchive.org

 

According to experts’ audit, 83.5% of mobile pages use a JavaScript library or framework with at least one known security vulnerability.

Tags: , , ,