JavaScript’s internal character encoding: UCS-2 or UTF-16?
Explores whether JavaScript uses UCS-2 or UTF-16 encoding, detailing the differences and implications for handling Unicode characters.
Mathias Bynens, a Chrome engineer at Google, explores JavaScript, HTML, CSS, Unicode, performance, and security, sharing deep insights into engine internals and web development best practices.
48 articles from this blog
Explores whether JavaScript uses UCS-2 or UTF-16 encoding, detailing the differences and implications for handling Unicode characters.
A technical guide explaining character escape sequences in JavaScript, covering code points, single character escapes, and encoding details.
Explores the smallest possible valid (X)HTML documents for various historical HTML versions, detailing byte counts and SGML minimization tricks.
Explains ambiguous ampersands in HTML, detailing character references and validity rules in HTML4 vs. HTML5 specifications.
Explains the JavaScript shorthand notation `foo#bar` as an alternative to `foo.prototype.bar` for referring to prototype methods.
Discusses shorthand notations for referring to HTML elements with specific attributes, comparing CSS, XPath, and custom syntax.
A JavaScript developer shares an improved pattern for detecting and safely using the localStorage API, including a robust feature test and local reference technique.
Explains the HTML ETAGO delimiter, its theoretical impact on <style> and <script> tags in HTML4, and how HTML5 standardized browser behavior.
Explains the rules and pitfalls of using unquoted attribute values in HTML, including when it's valid and how it interacts with CSS/JS selectors.
A defense of CSS hacks for browser targeting, comparing them to conditional stylesheets and classnames, and introducing the concept of 'safe CSS hacks'.
Explains using the HTML5 `oninput` event with `onkeydown` as a fallback for older browsers, including a jQuery plugin example.
A technical guide explaining touch icons for mobile web apps, covering HTML implementation, browser support, and visual effects across iOS and Android.
Explains how to enable AirPlay video streaming for web videos in iOS Safari using a JavaScript bookmarklet and proprietary HTML attributes.
A technical guide on reverse-engineering and speedrunning Dropbox's 2011 Dropquest scavenger hunt to achieve the fastest possible completion time.
Explains common pitfalls in JavaScript benchmarking and introduces tools like jsPerf and Benchmark.js to create reliable performance tests.
A technical exploration of how to use CSS without any HTML markup, demonstrating implied elements and HTTP headers.
A guide to creating simple Mac applications from shell scripts using the 'appify' tool and customizing their icons.
Explains how using setTimeout with a 0ms delay can speed up window.onload by preventing JavaScript from blocking the event.
Explains how and when to use CSS character escape sequences for targeting unusual class/ID names and inserting special characters.
HTML5 removes restrictions on the `id` attribute, allowing it to use the same wide range of characters as the `class` attribute.