javascript - What is the proper method to add tests to modernizr? - Stack Overflow

The test already exists in the github repo, but when I try to include it on my page I get an error, so

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(){)

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(){)

Share Improve this question asked Jul 9, 2012 at 0:39 DamonDamon 10.8k17 gold badges91 silver badges146 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

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./download/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744249944a4565121.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信