0

My (Drupal) project ( a shopping cart) works fine on all modern browsers. IE8 (and IE7) makes an exception. The jquery.js and all the js file are loaded, I can see them in View Source mode but the run stuck inside: jquery.js.

New Edit: My doctype is indeed which is relatively new but I have other projects on the same platform (Drupal) which run without errors on IE8 with the same doctype

Here are my prints from console mode in Developer Tools in IE9:

Browser mode: IE8 Document Mode: IE8 standards

   SCRIPT5022: Exception thrown and not caught 

    jquery.js?v=1.4.4, line 85 character 139
    >> typeof jQuery 
    "function" 
    >> typeof $ 
    "undefined" 

As seen above when in JS console in iE8 when I type: typeof $ the object is undefined, while in other browsers is function.

One possible solution that seems to be working is to set Document Mode as IE9: This works:

Browser mode: IE8 Document Mode: IE9 standards but this has no logic to me.

Other solutions I failed:

  1. different jquery.js versions: 1.4.4, 1.5.2, 1.6, 1.7.1, with or without CDN, with or without https://
  2. different doctypes.

This is complementary to [http://stackoverflow.com/questions/879137/problem-with-jquery-in-internet-explorer-8][4]

Faraderegele
  • 187
  • 4
  • 14
  • possible duplicate of [Problem with jQuery in Internet Explorer 8](http://stackoverflow.com/questions/879137/problem-with-jquery-in-internet-explorer-8) – Martijn Pieters Mar 23 '12 at 09:55
  • Also, why do you expect IE8 to know about IE9 standards? Did you mean `content="IE=EmulateIE7"` instead, like in the linked question? – Martijn Pieters Mar 23 '12 at 10:01
  • :) then why IE9 allows me to choose such an option? IE7 is malworking as well so if I understand well emulation is not a solution to my problem. – Faraderegele Mar 23 '12 at 10:21
  • IE9 knows about preceding versions, but not upcoming versions. You cannot tell IE9 to run in IE10 compatibility mode, but you can ask IE10 to behave like IE9. No timetravel allowed, even if you are Microsoft! – Martijn Pieters Mar 23 '12 at 10:33

2 Answers2

0

Probable explanation:

$ function is defined in Chrome's and Firefox's console itself, but it is a console's "internal" function. IE8 debug tools doesn't define such thing.

Even on empty tab, where there's no jQuery, $ is defined in Firebug and WebInspector consoles.

Also, your jQuery is ran in noConflict mode, which cleans up global $ reference.

kirilloid
  • 14,011
  • 6
  • 38
  • 52
0

This could more then one reseaon but what i think that the IE jumps into Qurik Mode because the doc type is not correct specified?

If this does not help you can try that:

if(typeof whatever != 'undefined') { ... }
SG 86
  • 6,974
  • 3
  • 25
  • 34
  • my doctype is indeed which is relatively new but I have other projects on the same platform (Drupal) which run without errors on IE8 with the same doctype. – Faraderegele Mar 23 '12 at 10:27