IE7 and IE8 are not letting me splice my array (Safari, Chrome, Firefox work):
lzaCreateAd1.weatherArray = new Array();
var jWeatherIcon = $('.weatherIcon');
jWeatherIcon.bind('click', function (){
var targetID = $(this).attr('id') + 'Box',
idVal = targetID.substr(5,1);
var jTargetBox = $('#'+targetID);
if (jTargetBox.hasClass('inactive')) {
jTargetBox.removeClass('inactive').addClass('active');
lzaCreateAd1.weatherArray.push(idVal);
} else if (jTargetBox.hasClass('active')) {
jTargetBox.removeClass('active').addClass('inactive');
lzaCreateAd1.weatherArray.splice(lzaCreateAd1.weatherArray.indexOf(idVal),1);
}
});
IE throws the following error: "Object doesn't support this property or method" for this line:
lzaCreateAd1.weatherArray.splice(lzaCreateAd1.weatherArray.indexOf(idVal),1);
Any ideas? Or other ways to remove an array item by value? Thanks in advance!