<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>object enabled dynamically</title>
  <style type="text/css">
   p { color: navy; }
   div { color: green; }
   dt { font-weight: bold; }
   dd { margin: 0 0 1em 2em; }
  </style>
  <script type="text/javascript">
   var results = '';
   function refresh() {
     if (document.getElementById('results'))
       document.getElementById('results').firstChild.data = 'Order of execution was: ' + results + '.';
   }
   function test(s) {
     if (results)
       results += ', ';
     results += s;
     var t = document.getElementById('test');
     if (!t)
       results += ' (not in DOM)';
     else if (!t.getElementsByTagNameNS)
       results += ' (no DOM2)';
     else if (t.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'div').length)
       results += ' (DOM ok)';
     else
       results += ' (DOM broken)';
     refresh();
   }
   function done() {
     test('load event fired')
     document.getElementById('test').data = 'http://non-resolving-domain.libpr0n.com/';
     test(4);
   }
   window.onload = done;
  </script>
 </head>
 <body>
  <p>Ensure scripts are enabled before loading this page.</p>
  <script type="text/javascript"> test(1); </script>
  <object width="300" height="100" id="test" data="fail.html">
   <div>This line should be green.</div>
   <script type="text/javascript"> test(2); </script>
  </object>
  <dl>
   <dt>This browser</dt>
   <dd id="results">Script did not execute.</dd>
   <dt>Firefox 0.8</dt>
   <dd>Order of execution was: 1 (not in DOM), 2 (DOM ok), 3 (DOM ok), load event fired (DOM ok), 4 (DOM ok). Change had <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=192891">no effect</a>.</dd>
   <dt>IE6</dt>
   <dd>XHTML not supported.</dd>
   <dt>Opera 7.50 Beta 1</dt>
   <dd>Order of execution was: 1 (no DOM2), 2 (no DOM2), 3 (no DOM2), load event fired (no DOM2), 4 (no DOM2). Line was green.</dd>
   <dt>Safari 1.2</dt>
   <dd>Order of execution was: 1 (DOM ok), 2 (DOM ok), 3 (DOM ok). Change had no effect.</dd>
  </dl>
  <script type="text/javascript"> test(3); </script>
 </body>
</html>

