IE9无法加载响应式布局

时间:2014-04-22 14:58:32

标签: javascript asp.net css internet-explorer responsive-design

更新1:

只有在构建并发布到IIS时才会出现问题。在视觉工作室中运行,没有问题。 IE9渲染正确。


IE9坏了,我不知道如何进行任何真正的测试。我的网站正确加载IE8,10和11,Chrome,Firefox和Opera,但不是IE9。

它应该是这样的(以及它在大多数浏览器中的外观):

non-ie-9

这是在IE 9中发生的事情(顶部的白色栏是应该隐藏的移动菜单):

ie-9

到目前为止,我唯一的工具是IE测试仪,如果它报告错误,我无法弄清楚如何查看。 IE11中的IE9模式实际上看起来很好(虽然我收到客户的投诉,所以我知道IE9实际上已经坏了)

以下是我在布局资产中加载的订单:

@Styles.Render("~/bundles/themes/crisp/css")
@Scripts.Render("~/bundles/jquery")
@Styles.Render("~/bundles/less")
@Scripts.Render("~/bundles/modernizr")

和bundleconfig

public class BundleConfig
{
    // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725

    public static void AddDefaultIgnorePatterns(IgnoreList ignoreList)
    {
        if (ignoreList == null)
            throw new ArgumentNullException("ignoreList");

        ignoreList.Ignore("*.intellisense.js");
        ignoreList.Ignore("*-vsdoc.js");
        ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
        //ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
        //ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);
    }



    public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.IgnoreList.Clear();
        AddDefaultIgnorePatterns(bundles.IgnoreList);


        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));

        /*bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                    "~/Scripts/jquery-ui-{version}.js"));

        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                    "~/Scripts/jquery.unobtrusive*",
                    "~/Scripts/jquery.validate*"));*/

        // Use the development version of Modernizr to develop with and learn from. Then, when you're
        // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                    "~/Scripts/modernizr-*"));

        /*bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

        bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                    "~/Content/themes/base/jquery.ui.core.css",
                    "~/Content/themes/base/jquery.ui.resizable.css",
                    "~/Content/themes/base/jquery.ui.selectable.css",
                    "~/Content/themes/base/jquery.ui.accordion.css",
                    "~/Content/themes/base/jquery.ui.autocomplete.css",
                    "~/Content/themes/base/jquery.ui.button.css",
                    "~/Content/themes/base/jquery.ui.dialog.css",
                    "~/Content/themes/base/jquery.ui.slider.css",
                    "~/Content/themes/base/jquery.ui.tabs.css",
                    "~/Content/themes/base/jquery.ui.datepicker.css",
                    "~/Content/themes/base/jquery.ui.progressbar.css",
                    "~/Content/themes/base/jquery.ui.theme.css"));*/

        bundles.Add(new StyleBundle("~/bundles/themes/crisp/css").Include(
                   "~/Content/themes/crisp/css/bootstrap.css",
                   "~/Content/themes/crisp/css/style.css",
                   "~/Content/themes/crisp/css/socialicoregular.css",
                   "~/Content/themes/crisp/css/font-awesome.css",
                   "~/Content/themes/crisp/css/hero-equal-thumb-gallery.css",
                   "~/Content/themes/crisp/css/tabs-toggle.css",
                   "~/Content/themes/crisp/css/portfolio.css",
                   "~/Content/themes/crisp/css/blog.css",
                   "~/Content/themes/crisp/css/gallery-folio-masonry.css",
                   "~/Content/themes/crisp/js/fancybox/source/jquery.fancybox.css",
                   "~/Content/themes/crisp/css/header-1.css"));

        bundles.Add(new ScriptBundle("~/bundles/themes/crisp/js").Include(
                    "~/Content/themes/crisp/js/bootstrap.min.js",
                    "~/Content/themes/crisp/js/custom.js"));

        bundles.Add(new LessBundle("~/bundles/less").Include(
                    "~/Content/NSA.less"));
    }
}

我不确定提供哪些其他信息,但随时可以提问!

(我认为)相关的CSS - 要避免变得冗长

https://gist.github.com/anwyatt/11183367

1 个答案:

答案 0 :(得分:1)

我的第一个猜测是怪癖模式,这对我来说是IE的主要痛苦......