Permalink
Browse files

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

…alled

even if the DOM was loaded before this script runs.
  • Loading branch information...
1 parent 4aa9087 commit d4c4fa98187966c89628b2d7382be36a5d3288b3 @rubys committed Sep 18, 2010
Showing with 6 additions and 2 deletions.
  1. +1 −1 themes/asf/index.html.xslt
  2. +5 −1 themes/asf/personalize.js
@@ -25,7 +25,7 @@
title="{atom:title}" type="{atom:link[@rel='self']/@type}" />
</xsl:if>
<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>
</script>
</head>
@@ -294,4 +294,8 @@ function personalize() {
}
// hook event
-document.addEventListener("DOMContentLoaded", personalize, false);
+if (document.getElementById('footer')) {
+ personalize();
+} else {
+ document.addEventListener("DOMContentLoaded", personalize, false);
+}

0 comments on commit d4c4fa9

Please sign in to comment.