本地网站呈现不同的使用(IP地址或机器名)与本地主机? [英] Local website renders differently using (IP address or machine name) vs localhost?

查看:197
本文介绍了本地网站呈现不同的使用(IP地址或机器名)与本地主机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MVC3(剃刀)上公布,以用于测试目的本地IIS7。

当我通过本地主机它看起来不同访问该网站从我访问使用的IP地址或计算机名?

我已经清除我的缓存,并重新加载页面,以确认他们仍然会出现不同。 CSS的必须加载给正确的字体/颜色等,但?:悬停元素出现加载慢得多

我使用JQuery / jQueryUI的网站上有没有什么帮助找出问题?

任何想法?

编辑:更多信息

标题,标签和表定义从ViewBag.Title建设,或通过行的视图模型循环 - 没有什么高明,只是标准的MVC3 /剃刀东西

相同的CSS文件用于每一页,和F12在IE8显示正确的CSS已经被载入。

标题/字幕字体大小/颜色是正确的,只是他们的定位是吗?
表格边框较厚的出现?
一般的定位似乎有点走出去,但我不明白为什么会有这种差异?

防火墙/ AV包可以去掉定位是什么?


解决方案

  

相同的CSS文件用于每一页,和F12在IE8示出了
  正确的CSS已经被载入。


开发人员工具应显示的IE不使用该网站的两个实例之间的相同的浏览器模式/文档模式,因为这里就是问题所在。 IE浏览器默认设置不同的模式取决于如果您使用的是机器名或没有(除其他事项外)。

添加以下内容到< HEAD> 应该理清这个问题:

 < META HTTP-EQUIV =X-UA-Compatible的内容=IE =边缘>

I have an MVC3 (razor) site published to IIS7 locally for testing purposes.

When I access the site via "localhost" it looks different from when I access using the IP address or machinename?

I have cleared my cache and re-loaded the pages to confirm and they still appear the different. The CSS must be loading to give the correct fonts/colours etc, although ":hover" elements appear to load much slower?

I am using JQuery/JQueryUI on the site if that helps identify the problem?

Any ideas?

Edit: More info

The titles, labels and table definition are build from ViewBag.Title, or looping through rows in a ViewModel - nothing clever, just standard MVC3/Razor stuff.

The same css file is used for every page, and F12 in IE8 shows the correct css has been loaded.

Title/subtitle font sizes/colours are correct, just their positioning is out? Table border appears thicker? Positioning generally seems a little "out", but I can't understand why there is this difference?

Can a firewall/AV package strip out positioning?

解决方案

The same css file is used for every page, and F12 in IE8 shows the correct css has been loaded.

Developer Tools should show that IE is not using the same "Browser Mode"/"Document Mode" between the two instances of the site, because that's the problem here. IE defaults to different modes depending on if you're using a machine name or not (amongst other things).

Adding this to your <head> should sort out the problem:

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

这篇关于本地网站呈现不同的使用(IP地址或机器名)与本地主机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆