I am using this code to alter the title of an image.
Basically it should split the dashes (there will always be at least one) and take the first part as the title and the remaining dashes as the description.
This works fine in FF but not in IE (tested in v8) it gives me 'Object doesn't support this property or method' on the description line.
I have tried all number of tests but IE just doesn't like parts[0] after it has been spliced. Any ideas?
$('.right ul li img').each(function() {
parts = $(this).attr('title').split('-');
title = $.trim(parts[0]);
parts.splice(0, 1);
description = $.trim(parts.join('-'));
title = '<strong>' + title + '</strong><br />' + description;
$(this).attr('title', title);
});