How DOM works/is loaded? (in HTML)

2019-06-06 04:26发布

How DOM is loaded in a html page? First is load the all html tag ( ) and inside of this element is created an other element and so on or first is create followed by ... and finally, the closing tags are added?

Thank you!

2条回答
贼婆χ
2楼-- · 2019-06-06 04:58

Generally the whole DOM is loaded into the memory, the order in which the elements are created is internal to the parser implementation and is not exposed.

If you need to parse as document loads you have to use SAX parsers

查看更多
劳资没心,怎么记你
3楼-- · 2019-06-06 05:16

More or less. The HTML 5.2 specification has a parsing algorithm.

查看更多
登录 后发表回答