Changeset 1157


Ignore:
Timestamp:
02/04/09 19:34:32 (11 years ago)
Author:
ray
Message:

#1383 IE 7 Secure and Nonsecure Warning

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r1147 r1157  
    59055905/** Adds a function that is executed in the moment the DOM is ready, but as opposed to window.onload before images etc. have been loaded 
    59065906*   http://dean.edwards.name/weblog/2006/06/again/ 
     5907*   IE part from jQuery 
    59075908*  @public 
    5908 *  @author Dean Edwards/Matthias Miller/ John Resig 
     5909*  @author Dean Edwards/Matthias Miller/ John Resig / Diego Perini 
    59095910*  @param {Function}  func the function to be executed 
    59105911*  @param {Window}    scope the window that is listened to 
     
    59315932   func(); 
    59325933 }; 
    5933  if (Xinha.is_ie) 
    5934  { 
    5935    scope.document.write("<sc"+"ript id=__ie_onload defer src=javascript:void(0)><\/script>"); 
    5936    var script = scope.document.getElementById("__ie_onload"); 
    5937       script.onreadystatechange = function() 
    5938    { 
    5939      if (this.readyState == "loaded") // We want this as early as possible, so I changed 'complete' to 'loaded', because otherwise it fired even after window.onload 
    5940      { 
    5941                 this.parentNode.removeChild(script); 
    5942        init(); // call the onload handler 
    5943      } 
    5944    }; 
    5945  } 
     5934  if (Xinha.is_ie) 
     5935  { 
     5936    // ensure firing before onload, 
     5937    // maybe late but safe also for iframes 
     5938    document.attachEvent("onreadystatechange", function(){ 
     5939      if ( document.readyState === "complete" ) { 
     5940        document.detachEvent( "onreadystatechange", arguments.callee ); 
     5941        init(); 
     5942      } 
     5943    }); 
     5944    if ( document.documentElement.doScroll && typeof window.frameElement === "undefined" ) (function(){ 
     5945      if (arguments.callee.done) return; 
     5946      try { 
     5947        // If IE is used, use the trick by Diego Perini 
     5948        // http://javascript.nwbox.com/IEContentLoaded/ 
     5949        document.documentElement.doScroll("left"); 
     5950      } catch( error ) { 
     5951        setTimeout( arguments.callee, 0 ); 
     5952        return; 
     5953      } 
     5954      // and execute any waiting functions 
     5955      init(); 
     5956    })(); 
     5957  } 
    59465958 else if (/applewebkit|KHTML/i.test(navigator.userAgent) ) /* Safari/WebKit/KHTML */ 
    59475959 { 
  • trunk/XinhaLoader.js

    r1132 r1157  
    221221  // Dean Edwards/Matthias Miller/John Resig  
    222222  // http://dean.edwards.name/weblog/2006/06/again/ 
     223  // IE part from jQuery 
     224   
    223225   
    224226  var init = function () 
     
    235237  if (Xinha.is_ie) 
    236238  { 
    237     document.write("<sc"+"ript id=__ie_onload defer src=javascript:void(0)><\/script>"); 
    238     var script = document.getElementById("__ie_onload"); 
    239     script.onreadystatechange = function() 
    240     { 
    241       if (this.readyState == "loaded") 
    242       { 
    243         init(); // call the onload handler 
    244       } 
    245     }; 
     239    // ensure firing before onload, 
     240    // maybe late but safe also for iframes 
     241    document.attachEvent("onreadystatechange", function(){ 
     242      if ( document.readyState === "complete" ) { 
     243        document.detachEvent( "onreadystatechange", arguments.callee ); 
     244        init(); 
     245      } 
     246    }); 
     247    if ( document.documentElement.doScroll && typeof window.frameElement === "undefined" ) (function(){ 
     248      if (arguments.callee.done) return; 
     249      try { 
     250        // If IE is used, use the trick by Diego Perini 
     251        // http://javascript.nwbox.com/IEContentLoaded/ 
     252        document.documentElement.doScroll("left"); 
     253      } catch( error ) { 
     254        setTimeout( arguments.callee, 0 ); 
     255        return; 
     256      } 
     257      // and execute any waiting functions 
     258      init(); 
     259    })(); 
    246260  } 
    247261  else if (/WebKit/i.test(navigator.userAgent)) 
Note: See TracChangeset for help on using the changeset viewer.