geek space web solutions

firstElementChild / firstChild‏ / children[0]

Thursday, 21 January 2010 16:55
Some time ago, I used the function in my javascript code firstElementChild. On Firefox it works fine but Internet Explorer does not work.

After some research, I discovered that indeed firstElementChild not working on any Internet Explorer but works on Firefox from version 3.5!
http://www.quirksmode.org/dom/w3c_traversal.html


So I decided to try with firstChild, which according to the link below works on all browsers:
http://www.quirksmode.org/dom/w3c_core.html

However, testing is now the opposite, my javascript works in IE but not Firefox! Indeed, once Firefox is misinterpreted, is apparently a well known problem GECKO engine is the indentation of the code that is the problem ! It would be a problem breaking space... In summary, if all tags are appressed to each other, firstChild work perfectly!


I decided then I dive into some of my old scripts that worked very well on most browsers. I used childNodes[0] which is exactly the same but is much less compatibility problems. I now use only childNodes[0]...
 

Add comment


Security code
Refresh

Sections

fisting porn

Last articles

position:absolute with ie6 d... Contrôler un SWF externe - E... Undefined property suite à u... Les nouveautés de Joomla 1.6... Créer son propre type de tra... Montage PC : Ventirad COOLER... Module Fade Rotator pour Joo... Bug Gestion des balises META... Erreur de Sécurité Flash Pla... Accélérer la fermeture de Wi...

Sondages

Do you think HTML5 can completely replace Flash ?
 
Would you be interested in an online XML editor ?
 

Paypal

paypal

Code du plugin Joomla AutoSEO 1.2 par www.geek-space.fr