Internet Explorer 8 issues with WordPress 3.8

I have a jsfiddle setup at http://jsfiddle.net/9nTg3/10/ for the menu but unfortunately I can even get JSFiddle to load on my Windows XP with IE8 computer

Yes, the whole jsfiddle editor environment is not compatible with older IE.

But when you call just the output document of your fiddle, using http://jsfiddle.net/9nTg3/10/show/, you can get that to show just fine in IE 8, and you will get an error message

SCRIPT1028: Expected identifier, string or number 

pertaining to line #80 of your document, which contains

$('<div/>', { id: 'sliding_menu_js', class: 'cerrado' }).appendTo('body');

class is considered a “reserved word” in JavaScript (although it is not actually used in the language), and older IE seem to be stricter about that than other browsers – so you have to put it into quotes to use it as an object key:

$('<div/>', { id: 'sliding_menu_js', 'class': 'cerrado' }).appendTo('body');

should work.

(And line #82 contains the same mistake again.)


Edit: There are a few more errors, f.e. you still have <?PHP … ?> code in your fiddle, you have a body element in there (which makes it end up having two bodies, since jsfiddle inserts that element for you) – and you forgot to close the top-most <div>.

With that all fixed, the menu shows up in IE 8 as well: http://jsfiddle.net/9nTg3/17/show/
(Obviously without transparency and shadow, but it shows up nonetheless.)

Leave a Comment