问题是,我已经在脚本jquery.min.js版本1.4上工作。必须升级到版本1.9.1后出现问题。Uncaught TypeError:无法读取未定义的属性'substr'
Uncaught TypeError: Can not read property 'substr' of undefined.
告诉我该怎么做。 这部分发生错误的代码。
var processCaption = function(settings){
var nivoCaption = $('.nivo-caption', slider);
if(vars.currentImage.attr('title') != ''){
var title = vars.currentImage.attr('title');
if(title.substr(0, 1) == '#') title = $(title).html();
if(nivoCaption.css('display') == 'block'){
nivoCaption.find('p').fadeOut(settings.animSpeed, function(){
$(this).html(title);
$(this).fadeIn(settings.animSpeed);
});
} else {
nivoCaption.find('p').html(title);
}
nivoCaption.fadeIn(settings.animSpeed);
} else {
nivoCaption.fadeOut(settings.animSpeed);
}
}
是什么瓦尔... – loveNoHate 2014-10-04 15:28:34
之前尝试,如果(vars.currentImage.attr( '标题')){ – artm 2014-10-04 15:33:07