utils.py
branchstable
changeset 7268 cd14e03124be
parent 7187 496f51b92154
parent 7267 2fe2ed459e4d
child 7278 1144a2d90314
child 7568 c5ee33fb6a3b
--- a/utils.py	Wed Apr 27 15:42:07 2011 +0200
+++ b/utils.py	Thu Apr 28 15:25:46 2011 +0200
@@ -230,7 +230,10 @@
     Request objects use a HTMLHead instance to ease adding of
     javascripts and stylesheets
     """
-    js_unload_code = u'jQuery(window).unload(unloadPageData);'
+    js_unload_code = u'''if (typeof(pageDataUnloaded) == 'undefined') {
+    jQuery(window).unload(unloadPageData);
+    pageDataUnloaded = true;
+}'''
     # Making <script> tag content work properly with all possible
     # content-types (xml/html) and all possible browsers is very
     # tricky, see http://www.hixie.ch/advocacy/xhtml for an in-depth discussion