IE10 and jQuery: SCRIPT5009: “$” is undefined

后端 未结 2 385
灰色年华
灰色年华 2020-12-16 12:48

I\'m faced with this really annoying problem, it appears in IE10 like in IE9. Given this HTML:


    Any Consult
    &l         


        
相关标签:
2条回答
  • 2020-12-16 13:29

    I had this problem with IE and found that the jQuery javascript file was corrupt in the IE developer tool. This was caused in my case by HTTP GZIP compression being done by the server but IE wasn't decompressing the file. I guess that if you turn off static HTTP compression or exclude the application/x-javascript from whatever is doing the compression (Mine was done by FluorineFX for all files over 10Kb) it should work okay once you have cleared your browser cache to get rid of the compressed javascript file.

    0 讨论(0)
  • 2020-12-16 13:32

    Place the conditional script after the jQuery library:

    <script type="text/javascript" src="scripts/jquery.js"></script>
    <!--[if lte IE 9]>
    <script src="scripts/IE9.js"></script>
    <![endif]-->
    
    0 讨论(0)
提交回复
热议问题