Statsy - more data points for markup quality
In the spirit of the content-to-markup ratio bookmarklet, here's another one that gives you some more data points to help you judge the quality of a page's markup and help answer the old question - where does all this page weight go.
Install the statsy bookmarklet
Drag this link to your bookmarks:
the results
Once you run the bookmarklet it alerts these stats points:
JS attributes (e.g. onclick)- this is the sum of allonclick,onmouseoverand so on including the attribute names. So for example<a onclick="#">is 11 characters (bytes) of JavaScript attributes codeCSS style attributes- the sum of allstyle="..."Inline JS- the sum of all the contents of all script tags (excluding the tag itself)Inline CSS- sum of all<style>tag contentsAll innerHTML- this isdocument.documentElement.innerHTML.length, it should be close to the ungzipped size of a page, provided the page is not doing a lot of DOM manipulation# DOM elements- the total number of elements on the page is counted simply usingdocument.getElementsByTagName('*').length
Here's example output:

The code
The code is here for your tweaking pleasure
Thanks!
Hope you'll find this bookmarklet useful when looking at a page as a companion to YSlow/PageSpeed.
What else should I add to this bookmarklet? # of font tags, # of table tags...?
This entry was posted on Monday, November 30th, 2009 and is filed under CSS, JavaScript, bookmarklets, performance. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Get notification for future posts: follow me on Twitter or subscribe to my RSS feed

December 29th, 2009 at 7:50 am
Might be interested to know how much fat you add to your server calls
Cookie size ?: document.cookie.length
December 30th, 2009 at 6:42 am
HI,
You forgot “onerror” in your jsattribs array