【问题标题】:Grails app is not being loaded only in IE9: what must I check?Grails 应用程序不仅在 IE9 中加载:我必须检查什么?
【发布时间】:2014-04-25 16:40:49
【问题描述】:

我正在开发一个使用一些 JS 代码的 Grails 项目。它在Google Chrome (v34.0.1847.116 m)Mozilla Firefox (v28.0), 中完美运行,但它根本无法在IE (v9.0.23). 中运行/启动我只是有一个空白屏幕。

根据 SO 社区的许多先前答案,我应该检查一些我正在使用的元标记,但它无论如何都没有成功运行。这是我的代码!

page.gsp,用作主布局:

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html class="win firefox firefox2 gecko gecko2" lang="br">
<!--[endif]-->

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="-1">
    <title><g:layoutTitle default="A nice Title"/></title>
    <r:require modules='core'/>
    <g:layoutHead />
    <r:layoutResources />    
</head>

<body>
    <div id="container">
        <div id="header">bla bla bla<g:navbar /></div>
        <g:menu menuKey="1"/> <!-- a taglib which builds a dynamic menu -->

        <div id="content">
            <g:layoutBody />
        </div>
    </div>

    <div id="footer"><div class="container">bla bla bla</div></div>
    <r:layoutResources/>
</body>
</html>

home.gsp,要在上面的布局中加载的简单视图。

<html>
<head>
    <meta name="layout" content="page" />
</head>
<body>
    <h2>A simple content here</h2>              
</body>
</html>

我正在使用 ApplicationResources.groovy 加载我的所有 JS 和 CSS 资源,但根据我的 Firebug,我没有任何 JS 错误。毕竟,我还能检查什么或者我必须确保哪些特性/功能成功?

【问题讨论】:

    标签: javascript html grails internet-explorer-9


    【解决方案1】:

    改变

    <!--[if (gt IE 9)|!(IE)]><!-->
    <html class="win firefox firefox2 gecko gecko2" lang="br">
    <!--[endif]-->
    

    to(适当关闭else评论)

    <!--[if (gt IE 9)|!(IE)]><!-->
    <html class="win firefox firefox2 gecko gecko2" lang="br">
    <![endif]-->
    

    【讨论】:

    • 上帝保佑你的下一代 99 代
    • 我怀疑你有点发疯了。
    • @VictorFS 看来这条评论是从心底冒出来的。 :)
    • 我今天也遇到了同样的问题...有些事情永远不会改变!
    猜你喜欢
    • 2019-07-14
    • 1970-01-01
    • 2016-02-21
    • 2020-08-13
    • 2020-01-14
    • 1970-01-01
    • 1970-01-01
    • 2016-09-05
    • 2012-06-21
    相关资源
    最近更新 更多