[wp-hackers] Using Modernizr for the new html5 input types

Gerasimos Tsiamalos tsiger at gmail.com
Mon Aug 22 16:40:03 UTC 2011


Hello everyone,

I am using Modernizr to test for some new html5 input types (number and
range to be more specific) and i was wondering if it's possible to combine
this test with wp_register_script / wp_enqueue_script. I mean for browsers
that natively support this type of inputs, everything's fine but for the
older ones i don't want to manually include my libraries. Here's an example:

*Modernizr.load([*
*  {   *
*    test : Modernizr.inputtypes.number, // my test  *
*    nope : [spinbox_js,spinbox_css], // if no support, load my custom libs*
*    complete: function() { *
*    ** **jQuery('.html5-number').spinbox(); // do my thing ** *
*    }*
*  }*
*]);*

Wouldn't be great if in the "nope" method i could include my libs using
wp_register_script/wp_enqueue_script?


-- 
Best Regards
--
*Gerasimos Tsiamalos*
twitter: @tsiger <http://www.twitter.com/tsiger>


More information about the wp-hackers mailing list