This is the code, changing a background image for a jQ plugin, Works fine on Chrome, FF, Safari and even my two smart phones. But not IE. Can anyone spot a problem?
<script type="text/javascript">
$(document).ready(function() {
$("#supersized img").attr({
src: "images/bg2.jpg",
});
$("#supersized").attr($("img"));
});
</script>
This problem is not only Internet Explorer related, as I notice only Firefox would execute it without warnings. The reason that object keys suppose to be escaped properly with single or double quotes in your case
and also remove coma after image path.
IE is very strict on its object literal formation. Many times it does not like you to put a comma after the last property. So in this instance the comma after your
src
property will give IE fits, most notoriously IE 6 & 7There's a trailing comma in your object literal. This always causes an error in IE browsers.