html - Javascript get characters in documents including css and javascript -


i looking length of entire document (as in str.length) , other files document may use. question (how entire document html string?) helpful, gives characters in current document not taking account linked js or css files. suggestions?

this entirely pseudocode, should you. while impossible guarantee accuracy of said length - due amount of variations in coding html, , how depth there page-to-page linking.

this use jquery.

var length = 0;  $(document).ready(function() {    //do whatever need to, current document link (using link provided above)    length = currentdocument.length;     //iterate through each link href    //do same script , src    $(document).find("link").each(function() {         var attr = $(this).attr("href");          //if accesses different server own, prolly fail          if (attr != null)         {            $.ajax({                 url: attr,                 async: false,                 success: function (data){                     length += data.length;                 }             });          }    }); } 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -