curious1
curious1

Reputation: 14727

Different behavior when using IP address and computer name to access a website

I am puzzled by this. I have a page with a dropdown menu. It behaves correctly in IE 10 and 11 (also in other browsers), but behaves different in IE 9.

I have two ways to access the page of my website: via computer IP address such as:

http://123.456.789.12/page.html

The other way is through computer name such as:

http://computer-name.com/page.html

When I use the IP address and move the mouse over the menu, the display is correct (dropdown menu): enter image description here

However, if using the computer name, I get this: enter image description here

I cleared cache, verified that they are the same page, etc. I cannot figure out why in IE 9, it has such behavior.

Does anybody know why? Fix?

Thanks and regards.

Update: This is the head of my page

<!DOCTYPE html>
<!--[if lt IE 7]>           <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>               <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>               <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
 <!--<![endif]-->

    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">

    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="/css/normalize.css">

    <link rel="stylesheet" href="/css/reset.css">

    <link rel="stylesheet" href="/lib/font-awesome-4.1.0/css/font-awesome.min.css">

    <link rel="stylesheet" href="/css/styles.css" />

    <script src="/lib/modernizr-2.6.2.min.js"></script>

    <script src="/lib/jquery-1.11.0.min.js"></script>

    <script src="/lib/jquery-ui-1.10.4/js/jquery-ui-1.10.4.js"></script>

    </head>

Update 2: found the solution at SO!

Html 5 Reset (html5reset.org) - X-UA-Compatible doesn't work

Upvotes: 2

Views: 1395

Answers (1)

SW4
SW4

Reputation: 71170

This is part of smart defaults, which switches the Browser/Document Mode between the two instances of the site.

In order to preserve compatibility, Internet Explorer ships with smart defaults based on zone evaluation. In the default state, all sites on the public internet display in Internet Explorer Standards mode (Compatibility View off) and all intranet websites display in Internet Explorer 7 Standards mode (Compatibility View on).

Add this to the head of your page:

<meta http-equiv="X-UA-Compatible" content="IE=edge">

Upvotes: 4

Related Questions