2

Is the DOM structure is browser dependent for the base HTML files.

If not then will the structure vary when the applications uses some java script libraries (Jquery/Extjs/etc) for the UI elements ?

4

2 回答 2

1

The DOM structure should be identical for browsers with the same capabilities, meaning any desktop browser should be loading the same DOM structure for the same document. However mobile browsers may be loading a different DOM structure if the UI is made responsive. UI libraries may or may not modify your DOM.

于 2013-04-26T06:01:36.070 回答
1

There are some situtaions where the dom structure can be different in different browsers.

  • An element is supported by one browser, but it is not in another (especiall very old) browser
  • The same applies to CSS attached to elements

Javascript libraries are free to act differently on different browsers, so there is no guarantee that the dom tree will be the same.

But in practice I've never enountered problems which were caused by differing DOM structures.

于 2013-04-26T06:06:34.820 回答