Handle load event on <object> - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Object

Description

Handle load event on <object>

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  av  a 2s . co m
    });

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

Related Tutorials