utils.py
changeset 7278 1144a2d90314
parent 7277 acd7f0e9f276
parent 7268 cd14e03124be
child 7423 598a4f051259
--- a/utils.py	Thu Apr 28 20:41:44 2011 +0200
+++ b/utils.py	Fri Apr 29 09:08:30 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