This will work in recent browsers, but you will need to change it to match older browsers ...
var commentNode = [].slice.call(document.head.childNodes).filter(function(node) {
return node.nodeType == 8;
})[0],
id = commentNode.data.match(/^\s*(\d+)/)[1];
...
var elem = document.createElement('div');
elem.id = 'id-display';
elem.appendChild(document.createTextNode(id));
document.body.appendChild(elem);
... CSS...
#id-display {
position: fixed;
bottom: 0;
right: 0;
background: #333;
color: #fff;
padding: 6px;
}
JSBin.