Defer the loading of personalize.js, and ensure that personalize is called

even if the DOM was loaded before this script runs.
This commit is contained in:
Sam Ruby 2010-09-18 19:51:35 -04:00
parent 4aa9087271
commit d4c4fa9818
2 changed files with 6 additions and 2 deletions

View File

@ -25,7 +25,7 @@
title="{atom:title}" type="{atom:link[@rel='self']/@type}" /> title="{atom:title}" type="{atom:link[@rel='self']/@type}" />
</xsl:if> </xsl:if>
<link rel="shortcut icon" href="/favicon.ico" /> <link rel="shortcut icon" href="/favicon.ico" />
<script type="text/javascript" src="personalize.js"> <script defer="defer" src="personalize.js">
<xsl:comment><!--HTML Compatibility--></xsl:comment> <xsl:comment><!--HTML Compatibility--></xsl:comment>
</script> </script>
</head> </head>

View File

@ -294,4 +294,8 @@ function personalize() {
} }
// hook event // hook event
document.addEventListener("DOMContentLoaded", personalize, false); if (document.getElementById('footer')) {
personalize();
} else {
document.addEventListener("DOMContentLoaded", personalize, false);
}