utils.py
brancholdstable
changeset 7267 2fe2ed459e4d
parent 7140 ba51dac1115d
child 7268 cd14e03124be
--- a/utils.py	Thu Apr 28 15:24:37 2011 +0200
+++ b/utils.py	Thu Apr 28 15:24:51 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