I've been playing with Modernizr in WordPress lately and here's something that i'm trying to achive.
I'm adding an HTML5 input field in a custom options page, specifically:
<input type="number" />
Now with Modernizr i can test if the browser supports it like this:
Modernizr.load([
{
test: Modernizr.inputtypes.number, // this is the test
nope: [ load js,css etc ] // if it's not supported load your custom lib
complete: function() {
// do something
}]);
Would it be possible instead of manually loading my custom libraries in the "nope" method, to invoke the wp_register_script()/wp_enqueue_script functions?
I mean i could just register/en-queue my custom libraries but i'd like to do that only if it's necessary (if the browser doesn't have native support for this kind of input type.
Any ideas?