tags:

views:

23

answers:

2

Can I somehow load a "broken" DOM tree in JavaScript

for example if someone forget to close a tag..

+1  A: 

probably not..unless you had like the DOM tree to be able to contains mistakes

+1  A: 

The current page? ...if this is an HTML document (ie. not served as XHTML) then the browser will auto-close (and even attempt to 'fix') certain elements that may at first appear 'broken'. When reading the current DOM, you are reading the fixed version. However, if the page is in fact 'broken' (or is just not standards compliant) then different browsers will 'fix' it differently. Depending on how broken is "broken", this may or may not be OK. If you are wanting this to work cross-browser, then this is probably not OK.

w3d