Domanda

In IE 8, siamo in grado di far emergere i Developer Tools. Poi sulla parte superiore, v'è una modalità del browser:

IE 7
IE 8
IE 8 Compatibility View

Quindi, se IE 7 è quello di forzare la pagina da visualizzare come se il browser è IE 7 e
IE 8 è quello di forzare la pagina da visualizzare utilizzando lo standard IE 8 come è,
Allora qual è la IE 8 "Compatibility View" extra per? Cosa serve? Se abbiamo già IE 7, perché bisogno di questa modalità in più? Che cosa significa questa modalità non che il modo IE 7 non può fare?

È stato utile?

Soluzione

La differenza sta nella stringa user agent.

"IE7" emula stringa user agent di IE7 esattamente, mostrando MSIE 7.0. "IE8" utilizza stringa agente utente nativa di IE8 esattamente, mostrando MSIE 8.0 così come Trident / 4.0, che è la versione del motore di layout Trident utilizzato in IE8.

IE8-compatibilità utilizza stringa agente utente nativa del browser, ma cambia "8.0" a "7.0".

A causa Trident non ha avuto un numero di versione precedente a IE7, la stringa IE7 non mostra "Trident / x.x". Quindi, con una stringa agente utente 7,0 MSIE, se "Trident / 4.0" è presente anche, sai che è IE8 in esecuzione in vista di compatibilità; se "Trident / x.x" non c'è, sai che è sia il vero IE7 o IE8 in modalità IE7 (non in modalità di compatibilità).

Spero che la mia spiegazione è abbastanza chiaro, ed ecco un esempio di alcune stringhe user agent di seguito.

IE7:

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; FDM; MS-RTC EA 2; Tablet PC 2.0; .NET4.0C; .NET4.0E)

IE8:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; FDM; MS-RTC EA 2; Tablet PC 2.0; .NET4.0C; .NET4.0E)

IE8-compatibilità:

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; FDM; MS-RTC EA 2; Tablet PC 2.0; .NET4.0C; .NET4.0E)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top