[Javascript] advanced programming standard mode and mixed mode

IE5.5 document introduces the concept of mode, and this concept by using a document type (DOCTYPE) switch implemented.

Two original document mode: promiscuous mode IE make the same behavior (including non-standard characteristics) IE5 promiscuous mode (quirks mode) and the standard modes (standards mode),

                                       The standard model is to make the behavior of IE closer to standards of conduct.

  Although both models mainly affects CSS rendering of the content, but in some cases also affect the interpretation of the implementation of Javascript.

  After the introduction of the concept of IE document mode, other browsers have followed suit. After this, IE also proposed a so-called quasi-standard mode (almost standards mode). This kind

Browser features in standard mode there are many, but not all. Non-standard place mainly reflected in the picture when dealing with the gap (the most obvious problem when using the picture in the table).

  If no document type declaration at the beginning of the document, then all browsers will default on promiscuous mode . But promiscuous mode is not a recommended practice, as different browsers

Behavioral differences in this mode is very large, if not to apply certain technical hack, cross-browser behavior is simply not consistent at all.

  For standard mode, you can open a document by using any of the following type:

  <-! HTML 4.01 Strict -> strict.dtd

  <-! XHTML 1.0 Strict -> xhtml-strict.dtd

  <!-- HTML5-->   <!DOCTYPE html>

  For pre-standard mode, you can use the transition (transitional) or frameset type (frameset) to trigger the type of document

  <-! HTML 4.01 Transitional -> ...... Transitional ...... loose.dtd

  <-! HTML 4.01 frameset type -> ...... Framest ...... framest.dtd

  <-! XHTML 1.0 Transitional -> ...... ...... Transitional XHTML-transitional.dtd

  <-! XHTML 1.0 frameset type -> ...... Framest ...... xhtml-framest.dtd

  Semi-standard mode and standard mode is very close to, their difference is almost negligible. Thus, when someone mentions the "standard model" may be referring to either of these modes.

 

 

Reproduced in: https: //www.cnblogs.com/positive/p/3727136.html

Guess you like

Origin blog.csdn.net/weixin_33709364/article/details/93495802