Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'match' of undefined #376

Closed
FDiskas opened this issue Jun 20, 2016 · 5 comments
Closed

Uncaught TypeError: Cannot read property 'match' of undefined #376

FDiskas opened this issue Jun 20, 2016 · 5 comments

Comments

@FDiskas
Copy link

FDiskas commented Jun 20, 2016

lightgallery.js:417 Uncaught TypeError: Cannot read property 'match' of undefined

Here is example http://jsfiddle.net/1tygp6sk/1/

@sachinchoolur
Copy link
Owner

You are missing the data-src attribute. Here is the updated jsfiddle. http://jsfiddle.net/1tygp6sk/2/

@mdmasumbillah
Copy link

mdmasumbillah commented Jun 11, 2017

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
                });

@sachinchoolur
Copy link
Owner

Please provide the URL of your website or a jsFiddle which demonstrates your issue.

@sugandhhgoyal
Copy link

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), :4:333)
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)

@sugandhhgoyal
Copy link

sugandhhgoyal commented Jun 14, 2017

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;
	}
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants