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.
if you mean just the html then you can use jQuery to do get the number of characters (bytes in most cases, depending on the encoding)
$(document).ready(
function()
{
var pagebytes = $('html').html().length;
var kbytes = pagebytes / 1024;
}
);
this basically counts number of characters contained within (including) tag. that will exclude any Doctype specified, but since that would be static always you can add length of doctype to pagebytes.
//Edit
looks like doctype in the end may not be static. but without it, it still should be accurate enough.