Danke ihr beiden.
Mit:
<html>
<body>
<script>
document.addEventListener("DOMContentLoaded", function(){
alert(document.documentElement.innerHTML);
}, false);
</script>
<script>
var Variable;
</script>
</body>
</html>
funktioniert es.