What is a DOMString really?

It’s an implementation-independent DOM interface for UTF-16 strings.

JavaScript strings are already UTF-16 strings, so any instance of a JavaScript String is automatically also a DOMString instance.

The interface is meant for implementations whose strings are not natively UTF-16 sequences, so they can implement a separate type to map to DOMString if necessary. The reason an implementation-independent interface is necessary is, as the spec states, “[to] ensure interoperability”.

Why is it called DOMString? Presumably because it’s related to the DOM. How does it relate to the DOM? Well, it’s part of the DOM standard, for one.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)