24 March, 2014

Force the Client’s browser document mode from server side setting

I really was puzzled as to why my local browser (dev. machine) rendered my website perfectly, whereas when deployed to a production server (and thus a different IIS, mind you) it failed to render basically anything.

It turns out that the IIS sends a HTTP Response Header that directs how the Client browser should interpret and render the document. Before you say “duh?”, this is the “document mode” introduced in IE in the later incarnations. It is not sufficient to just enter a !DOC variable in the HTML of the document, you need also to set the x-UA-Compatible variable as well. This is easily done directly from IIS as seen below. When setting this on the website directly in IIS, it will be written to the site’s web.config file behind the scenes.

This header takes several values (IE 7..10), but the below will make it render in most modern browsers.


Information: http://technet.microsoft.com/en-us/library/dn321432.aspx

It actually turns out that you should be using this value: IE=Edge

Technorati Tags: ,

No comments:

iPhone/XCode - not all cases are equal!

This bit me! Having made some changes to an iPhone application (Obj-C); everything worked fine in the simulator. But, when deploying the s...