Referring to this question , how can i get the current page size in kb, this size i will use to know the connection speed for this page.
There is a non-standard property available only for IE - document.fileSize MDN MSDN. It returns the size of the html page in bytes.
Or you can get the content-length header
var request = new XMLHttpRequest();
request.open('GET', document.location, false);
request.send();
var size = request.getAllResponseHeaders().toLowerCase().match(/content-length: \d+/);
document.getElementById("size").innerHTML = size + " bytes";