The following script below is not running in IE7 but works perfectly fine in IE 8 + 9 and ALL other browsers. Even putting in the alert("something");
does not work - I have another script that is working fine and that is running in IE 7 perfectly.
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
Am I missing a DOCTYPE? Here is the script below;
var formPageTitle = $("div.hsRadarform td h3").text();
$('.AspNet-DataList td a').each(function (index) {
var listElementText = $(this).text();
var shade = "faint";
if(formPageTitle.toLowerCase() == listElementText.toLowerCase()) {
shade = "dark";
}
//adding the numbered circles here using jQuery
$(this).css({
'background-image': 'url(/assets/img/radarstep' + (index + 1) + shade + '.png)',
'background-repeat': 'no-repeat',
'height': '25px',
'width': '25px',
});
});
IE is very picky with trailing commas :
$(this).css({ 'background-image': 'url(/assets/img/radarstep' + (index + 1) + shade + '.png)',
'background-repeat': 'no-repeat',
'height': '25px',
'width': '25px',
});
Should be
$(this).css({ 'background-image': 'url(/assets/img/radarstep' + (index + 1) + shade + '.png)',
'background-repeat': 'no-repeat',
'height': '25px',
'width': '25px' // comma removed
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With