Changeset 252

Show
Ignore:
Timestamp:
09/27/06 11:27:41 (2 years ago)
Author:
ogawa
Message:

Add attachBeforeUnload so as to call GUnload() properly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Mapper/trunk/Mapper.pl

    r250 r252  
    134134//<![CDATA[ 
    135135function attachOnLoad(func) { 
    136     if (window.addEventListener) 
     136    window.attachEvent ? 
     137        window.attachEvent('onload',func) :  
    137138        window.addEventListener('load',func,false); 
    138     else if (window.attachEvent) 
    139         window.attachEvent('onload',func); 
     139
     140function attachBeforeUnload(func) { 
     141    window.attachEvent ? 
     142        window.attachEvent('onbeforeunload',func) :  
     143        window.addEventListener('beforeunload',func,false); 
    140144} 
    141145function generateGMap(mapid, address, lat, lng, zoom, maptype) { 
     
    157161    } 
    158162} 
     163attachBeforeUnload(function(){GUnload()}); 
    159164//]]> 
    160165</script>