For the sake of clarity, the following is explained in the simplest HTML and JavaScript. There is such a piece of HTML (the head part is the standard head, and the doctype uses the xhtml-transitional DTD):
Now, we use two methods to get the number of param parameters of the first object (swf):
var o = document.getElementsByTagName('object')[0];
alert(o.getElementsByTagName('param' ).length);
alert(o.childNodes.length);
Guess what the results are? Also, guess what o.innerHTML is? You can try it yourself. The above results are 4 and 2 respectively. Isn’t it weird?