lightgallery.js:417 Uncaught TypeError: Cannot read property 'match' of undefined
Here is example http://jsfiddle.net/1tygp6sk/1/
You are missing the data-src
attribute. Here is the updated jsfiddle. http://jsfiddle.net/1tygp6sk/2/
Show a problem "Uncaught TypeError: Cannot read property 'match' of undefined at Plugin.isVideo" . when one image included, it's work properly but more than one images than It's not work properly and error show
when one image:
<div class=" js-lightgallery">
<a href="{{fullUrl}}" data-src="{{fullUrl}}">
<img src="{{fullUrl}}" data-name="{{name}}" title=""/>
</a>
</div>
when images
<div class=" js-lightgallery">
<a href="{{fullUrl}}" data-src="{{fullUrl}}">
<img src="{{fullUrl}}" data-name="{{name}}" title=""/>
</a>
<a href="{{fullUrl}}" data-src="{{fullUrl}}">
<img src="{{fullUrl}}" data-name="{{name}}" title=""/>
</a>
<a href="{{fullUrl}}" data-src="{{fullUrl}}">
<img src="{{fullUrl}}" data-name="{{name}}" title=""/>
</a>
</div>
js:
$(".js-lightgallery").lightGallery({
thumbnail:true,
animateThumb: true,
download: false
});
Please provide the URL of your website or a jsFiddle which demonstrates your issue.
hey I am getting the same error ,what should i do?
error----
angular.min.js:117 TypeError: Cannot read property 'match' of undefined
at brandController.vm.checkCommunicationType (scripts.js:315)
at fn (eval at compile (angular.min.js:230),
at n.$digest (angular.min.js:142)
at n.$apply (angular.min.js:145)
at l (angular.min.js:97)
at H (angular.min.js:101)
at XMLHttpRequest.u.onload (angular.min.js:102)
vm.enableDisableCommunication = function(comm , flag , type,communicationName){
console.log(flag);
let tText = flag?"disable" : "enable" ;
let tText2 = type==1? "SMS" :"EMAIL" ;
let message =
Are you sure you want to ${tText} ${communicationName} ${tText2} ;
dailogService.showConfirm(null,message)
.then( ()=>{
let params= {};
params.productId = vm.productId;
params.communicationType = comm;
//params.communicationName = comm;
if(type==1){
params.smsStatus = flag;
}
if(type==2){
params.emailStatus = flag;
}
return brandService.enableDisableCommunication(vm.brandId ,params);
}).then((rs)=>{
toast.showSimpleToast(
${communicationName} ${tText2} has been ${tText}d`);
}).catch((error)=>{
console.log(error);
if(type==1){
vm.productDetailedInfo[comm].smsStatus = !flag;
}
if(type==2){
vm.productDetailedInfo[comm].emailStatus = !flag;
}
});
}
vm.showPercentage = function(val1 , total){
return (val1*100)/total;
}
vm.showPercentageComm = function(val1 , total1,total2){
return (-val1*100)/(-total1 + -total2);
}
vm.checkCommunicationType=function(commType){
if(commType.match(/otp/ig) ){
return true;
}else{
return false;
}
}`
Most helpful comment
You are missing the
data-src
attribute. Here is the updated jsfiddle. http://jsfiddle.net/1tygp6sk/2/