document.body.offsetWidth is not yet defined when still processing head
authorGuillaume Cottenceau <gcottenc@gmail.com>
Tue, 5 Oct 2010 20:09:31 +0000 (22:09 +0200)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Tue, 5 Oct 2010 20:09:31 +0000 (22:09 +0200)
lib/booh/html-merges.rb

index 713f43a75af18b3cc2932d899c1c727cc462e4d8..018d4df5765fe40eb9afabb9e37ee303b359e6f5 100644 (file)
@@ -152,13 +152,11 @@ function getPreferredSize() {
     return 'thumbnails-~~default_size~~-0~~htmlsuffix~~';
 }
 
-window.location.href = getPreferredSize();
-
         </script>
 
         <meta http-equiv="refresh" content="0.1;url=thumbnails-~~default_size~~-nojs-0~~htmlsuffix~~" />
     </head>
-    <body>
+    <body onload="window.location.href = getPreferredSize()">
     </body>
 </html>
 EOF