Friday, March 26, 2010

Function your old script and CSS on IE8

Implementing the META Switch on IIS
Windows Internet Explorer 8 introduces document compatibility modes that allow Web developers to tell the browser to render their pages in the same way as older versions would. The compatibility mode can be specified on a per-page or per-site basis. Long story show. it's for automatic enable compatibility view on IE8 for your old pages designed for IE6,7.

2 ways to do, either on application layer or webserver layer:
The following is web.config example for application:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>

You can also configure IIS 7 on a Windows Server 2008-based computer to include a custom HTTP response header by following these steps:
  1. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. In the connections pane, expand the node for the server, and then expand .
  3. Click the Web site where you want to add the custom HTTP response header.
  4. In the Web site pane, double-click in the section.
  5. Under Actions, click Add.
  6. In the Name box, type X-UA-Compatible.
  7. In the Value box, type IE=EmulateIE7.
  8. Click OK.
To configure IIS 6 and earlier versions to include a custom HTTP response header, follow these steps:
  1. Click Start, click Run, type inetmgr.exe, and then click OK.
  2. Expand the server you want and then expand Web Sites.
  3. Right-click the Web site you want and then click Properties.
  4. Click the HTTP Headers tab.
  5. Under Custom HTTP headers, click Add.
  6. In the Custom header name box, type X-UA-Compatible.
  7. In the Custom header value box, type IE=EmulateIE7.
  8. Click OK two times.

0 comments:

Post a Comment