I'm facing a weird behavior of IE7.
In my application I have a dozens of JSs and CSSs files. Due to the number of requests to load each page, I decided to pack all them together in just two files, a bundle with all the CSS files (css_pack.css) and another one with all the JS files (js_pack.js).
Everything goes fine with FF, Chrome, IE8. The problem is on displaying my application on IE7. In IE7 it seems that the packs (both css and js) are not being read. That is, my application is entirely out of formating and lost a lot of dynamic js bahavior (jquery).
After a lot of tests I tried to remove the bundles and point each file separately. Now, the things come back to work in IE7, along with my performance issue...
Well, is this familiar to anyone? Why only IE7 don't like my bundles?
UPDATE:
This is a piece of my head section:
<head>
<link rel="stylesheet" href="<c:url value="/css/blueprint/screen-nopack.css"/>" type="text/css" media="screen, projection">
<link rel="stylesheet" href="<c:url value="/css/blueprint/print-nopack.css"/>" type="text/css" media="print">
<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/css/blueprint/ie-nopack.css"/>" type="text/css" media="screen, projection"><![endif]-->
<link rel="stylesheet" href="<c:url value="/css/css_pack.css"/>" type="text/css" media="screen, projection">
<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/css/11-jqtransform.css"/>" type="text/css" media="screen, projection"><![endif]-->
<script type="text/javascript" src="<c:url value="/js/js_pack.js"/>"></script>
<!--[if IE]> <script type="text/javascript" src="<c:url value="/js/excanvas-nopack.js"/>"></script> <![endif]-->
</head>
The file pointed by the line...
<!--[if lt IE 8]><link rel="stylesheet" href="<c:url value="/css/11-jqtransform.css"/>" type="text/css" media="screen, projection"><![endif]-->
... makes part of the css bundle (css_pack.css). However, it's content is only read by IE when it's distinct line is added to the head...
UPDATE2
This is the HTML code generated by the processing of the previous JSP and received by IE7:
<head>
<link rel="stylesheet" href="/GestorAMPB/css/blueprint/screen-nopack.css" type="text/css" media="screen, projection"&g开发者_高级运维t;
<link rel="stylesheet" href="/GestorAMPB/css/blueprint/print-nopack.css" type="text/css" media="print">
<!--[if lt IE 8]><link rel="stylesheet" href="/GestorAMPB/css/blueprint/ie-nopack.css" type="text/css" media="screen, projection"><![endif]-->
<link rel="stylesheet" href="/GestorAMPB/css/css_pack.css" type="text/css" media="screen, projection">
<!--[if lt IE 8]><link rel="stylesheet" href="/GestorAMPB/css/11-jqtransform.css" type="text/css" media="screen, projection"><![endif]-->
<script type="text/javascript" src="/GestorAMPB/js/js_pack.js"></script>
<!--[if IE]> <script type="text/javascript" src="/GestorAMPB/js/excanvas-nopack.js"></script> <![endif]-->
</head>
what method do you use to pack these resources? i assume you must cat them together first, this is where some problems can come in for you.
in the case of js files make sure they each have a newline at the end of the file and last line ends with ;
in the case of css files, do you have any css that runs js code? ive seen issues with this when its catted together.
finally, have you tried ie debugging tools to see how much of the js/css is loaded? usually there is an problem where some percent of the file loads while the rest does not, find out where that break is and look in the catted file output
精彩评论