utils.py
branchstable
changeset 7268 cd14e03124be
parent 7187 496f51b92154
parent 7267 2fe2ed459e4d
child 7278 1144a2d90314
child 7568 c5ee33fb6a3b
equal deleted inserted replaced
7264:9ed9e1d77ef3 7268:cd14e03124be
   228     """wraps HTML header's stream
   228     """wraps HTML header's stream
   229 
   229 
   230     Request objects use a HTMLHead instance to ease adding of
   230     Request objects use a HTMLHead instance to ease adding of
   231     javascripts and stylesheets
   231     javascripts and stylesheets
   232     """
   232     """
   233     js_unload_code = u'jQuery(window).unload(unloadPageData);'
   233     js_unload_code = u'''if (typeof(pageDataUnloaded) == 'undefined') {
       
   234     jQuery(window).unload(unloadPageData);
       
   235     pageDataUnloaded = true;
       
   236 }'''
   234     # Making <script> tag content work properly with all possible
   237     # Making <script> tag content work properly with all possible
   235     # content-types (xml/html) and all possible browsers is very
   238     # content-types (xml/html) and all possible browsers is very
   236     # tricky, see http://www.hixie.ch/advocacy/xhtml for an in-depth discussion
   239     # tricky, see http://www.hixie.ch/advocacy/xhtml for an in-depth discussion
   237     xhtml_safe_script_opening = u'<script type="text/javascript"><!--//--><![CDATA[//><!--\n'
   240     xhtml_safe_script_opening = u'<script type="text/javascript"><!--//--><![CDATA[//><!--\n'
   238     xhtml_safe_script_closing = u'\n//--><!]]></script>'
   241     xhtml_safe_script_closing = u'\n//--><!]]></script>'