document.documentElement.innerHTML.lengthaccording to @meder is probably good enough. This will be inaccurate because it returns the serialization of the current DOM page, not the original HTML source.
, , , , ... , script, innerHTML, , , .
, , , XMLHttpRequest URL-:
var xhr= new XMLHttpRequest();
xhr.onreadystatechange= function() {
if (this.readyState!==4) return;
alert(this.responseText.length);
};
xhr.open('GET', location.href, true);
xhr.send();
( , POST.)
. , ISO-8859-1, . UTF-8, , UTF-8- , :
var bytes= unescape(encodeURIComponent(this.responseText));
alert(bytes.length);
, , UTF-8, ; , .