Question

The test already exists in the github repo, but when I try to include it on my page I get an error, so I'm not sure how I need to include it in my document. In my html <head> tag I link the modernizr script and then link to the test I am adding:

<script src="js/modernizr-2.5.3-min.js"></script>
<script src="js/css-pointerevents.js"></script>

css-pointerevents.js

When I load the page now I get a javascript error: Uncaught TypeError: Object #<Object> has no method 'addTest' which must be a reference to the first line of css-pointervents.js (Modernizr.addTest('pointerevents', function(){)

Was it helpful?

Solution

It is because the addTest functionality is not included in the default base build of Modernizr . Need to add it specifically (under extensibility) http://modernizr.com/download/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top