jquery-ui-touch-punch icon indicating copy to clipboard operation
jquery-ui-touch-punch copied to clipboard

Getting error 'Cannot read property 'support' of undefined.'

Open sandi283 opened this issue 9 years ago • 2 comments

In my project whenever i load the page containing jquery punch, i am getting an error 'Cannot read property 'support' of undefined'.

I have jquery 1.10.2, jqueryui 1.11.4. Also jquery punch is added below these two.

Please can you guide what can be done to resolve this error.

Thanks, Sandesh Naik

sandi283 avatar Jan 08 '17 14:01 sandi283

To give more idea, the issue is occurring at line 'if(a.support.touch="ontouchend"in document,a.support.touch)' in jquery punch file

sandi283 avatar Jan 08 '17 14:01 sandi283

Use the non-minimized version of touch-punch to report where errors are happening. IMHO, min version should only be used in production once the full version has been completely tested. Most important is that you have both versions available: very frustrating troubleshooting and only having min version available.

In the min version, the entire file is one line. It looks like the error line is on is in the very beginning of jquery.ui.touch-punch.js: $.support.touch = 'ontouchend' in document;

I was able to have this issue in the known way, having touch-punch script tag before jquery-ui script tag. Please publish the entire head of your HTML page next time. Perhaps your code for making tag draggable is not waiting for the HTML page being ready? I recommend using:

$(function() {
	$('#DragMe').draggable();
});

Good Luck, Ray

Raymond-Naseef avatar Jan 08 '17 15:01 Raymond-Naseef