Handle DOMContentLoaded on window - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window Load

Description

Handle DOMContentLoaded on window

Demo Code

ResultView the demo in separate window

<!doctype html>
<html lang="en-US">
   <head></head>
   <body> 
      <object data="http://your server.svg" type="image/svg+xml" id="obj"></object> 
      <script type="text/javascript">
    window.addEventListener('DOMContentLoaded', function() {
        var obj = document.getElementById('obj');
        obj.addEventListener('load', function(){
            console.log('loaded');
        });//from   w w  w  .  j a  va 2 s. c  om
    });

      </script>  
   </body>
</html>

Related Tutorials