html - IE9 sometimes switching to Document Mode: IE7 Standards -


i imagine might quick , easy question who's more familiar ie browser modes.

we have intranet application window that's switching 'document mode: ie7 standards' (w/ browser mode: ie9) per dev tools -- relatively rarely, it's hard tell leads issue. result form fields jumbled, css/floats skewed, scripts don't work right, etc. once problem occurs, way solve close browser , restart internet explorer.

we found user while experiencing glitch, opened dev tools, , confirmed document mode had set ie7 , changing ie9 fixed everything. still, once has set ie7, way default ie9 close out of browser. otherwise, if close window not whole browser, it's ie7 each time open window.

i don't know causing issue intermittently. thought doctype? can offer advice?

<%@ page language="c#" autoeventwireup="true" codebehind="appscreen.aspx.cs" inherits="project.appscreen" %> <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="asp" %>  <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">  <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <link href="~/styles/appscreen.css" rel="stylesheet" type="text/css" />     <script src="scripts/jquery-1.4.1.js" type="text/javascript"></script>     <title>title</title>      <script type="text/javascript">     //a couple other quickie scripts     </script> </head> 

you want find out root of problem, here goes:

ie has config setting specifies use compatibility mode sites on local intranet. config setting defaults being switched on.

this setting exists purpose of assisting corporates upgrading ie version don't want upgrade intranet software.

the problem of course many intranets don't fall category; want ie use best mode on intranet. setting had have default 1 way or other, , microsoft chose default on.

so solution go round pcs on intranet , turn setting off. (some users may have switched off themselves, or had set way installation, explain why doesn't happen everyone).

alternatively, can put meta tag force ie use preferred mode:

<meta http-equiv="x-ua-compatible" content="ie=edge"/> 

here, ie=edge tells ie use best available mode, rather fixing specific ie version.

to honest, it's idea put meta tag code anyway, avoid random issues remaining users might have set ie wrong mode somehow.

you can specify x-ua-compatible flag http header if don't want cluttering html code.

finally, veering off topic, it's worth noting definition of "local intranet" includes sites running on own pc. means setting catches out novice web developers working on localhost don't know setting.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -