开发者

On few machine I get - 'css was ignored due to mime type mismatch'

I have deployed my ASP.NET on the production server. It has been working properly but recently I came to know that in one of the client machine with IE9 (of same version as mine) the site is not rendering properly - does not load up the CSS and javascripts.

When I got the screenshot of F12 (dev tool in IE9) from client, I found that all the CSS errors had this message - "css was ignored due to mime type mismatch" and the javascript showed - 'SCRIPT1002: Syntax Error'

Any suggestion is highly appreciated. I have tried all that came to my mind... I am lost now/

here is the response HTML that is recieved at client -

Site

    <script src="/Utility/global.js?Version=2.1.61120.2" type="text/javascript"></script>
    <script src="/Scripts/jquery-1.4.1.min.js?Version=2.1.61120.2" type="text/javascript"></script>
    <script src="/Scripts/global.js?Version=2.1.61120.2" type="text/javascript"></script>
    <style type="text/css"> body { font-size: 84%; } </style>
    <link rel="stylesheet" href="/Themes/default/style/Global.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="/Themes/default/style/Common.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="/Themes/default/style/common_print.css" type="text/css" media="print" />
    <link rel="stylesheet" href="/Themes/default/style/forum.css" type="text/css" media="screen" />
    <link rel="stylesheet" href=开发者_Python百科"/Themes/default/style/forum_print.css" type="text/css" media="print" />
    <script src="/Utility/global.js?Version=2.1.61120.2" type="text/javascript"></script>
    <link rel="stylesheet" href="/Themes/default/style/projects.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="/Themes/default/style/sticky-footer.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="/Themes/default/style/blog.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="/Themes/default/style/menu.css" type="text/css" media="screen" />


Is CSS inline (inside <style> tags), imported (@import inside <style>) or external (<link>)? If imported or external, is it on CDN and what is the "Content-Type" HTTP response header sent? If internal, does your <style> contains the "type" attribute?


Check the headers with curl

curl -I http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css

Next go to AWS S3 console, go to the file > properties > metadata and confirm they are set.

IE can be very particular about content types.

On few machine I get - 'css was ignored due to mime type mismatch'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜