Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Wed, 16 Nov 2005 11:00:44 +1100,    group: microsoft.public.inetsdk.programming.html_objmodel        back       


'object' element in the DOM   
Hi.

I want to replace an 'object' element in my document with script,
however I find that it disappears from the DOM tree if it has to
fallback to its children because it cannot handle the given type.

For example:

  <html>
    <head><title>test</title></head>
    <body id="b">
      <script>
        function f() {
          for (var n = document.getElementById('b').firstChild;
               n != null;
               n = n.nextSibling) {
            window.alert(n.nodeName);
          }
        }
      </script>
      <object data="x" type="x" width="200" height="200">
        didn't work
      </object>
      <button onclick="f()">test</button>
    </body>
  </html>

Clicking the button finds the 'script' and 'button' elements but not the
'object' element, which is strange because it still should be in the
document tree.  I need to write some script that manipulates the object
elements in the document, regardless of whether they fail to render
their content.  How can I do this?

Thanks,

Cameron

-- 
  e-mail : cam (at) mcc.id.au    	icq : 26955922
     web : http://mcc.id.au/	        msn : cam-msn (at) aka.mcc.id.au
  office : +61399055779		     jabber : heycam (at) jabber.org
date: Wed, 16 Nov 2005 11:00:44 +1100   author:   Cameron McCormack See signature for e-mail address:;

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us