Digiguru.co.uk

Take a shortcut, and suffer the concequences

08 Jun 2011

Reading time: 1 minute

I have recently started programming in a more jquery centric style, to make sure that all the javascript on our sites are AWESOME! I was testing our latest control cross browser and found that IE 8 and lower didn't like my plugin. Digging into developer tools (f12) the following line was throwing an error. thumbnailImage: $("<img />", { class: "imgThumb", alt: "thumbnail", src: "/images/hba/noImage.gif" }), I could see in developer tools that it had written the word "class" in blue in IE Developer tools, meaning it is reserved as a function, not allowed in my jQuery string. This is easily fixed... thumbnailImage: $("<img />", { "class": "imgThumb", alt: "thumbnail", src: "/images/hba/noImage.gif" }), Removes the error. NICE!