CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
JavaScript Jungle
Disable script if device has input type="date" support?
AndyHowells
Permalink to comment
#
June 2012
Hi all,
Does anyone know of a way that I can effectively disable or unload a script if input type="date" is supported?
I'm doing a design right now that I'm using datepicker.js for a dropdown to select a start and finish date for staying at a country house.
However, I would like to use the built in date picker that comes on iOS and other browsers.
Is there a way to disable the javascript that creates the drop down gallery if the device supports input type="date" natively?
Linky here:
Contact Page
Mottie
Permalink to comment
#
June 2012
Instead of disabling a script, why not use
Yepnope.js
to load the script if needed.
AndyHowells
Permalink to comment
#
June 2012
Thanks
@mottie
, hadn't thought of going the other way around! Just googled it and found this on here if anyone else is looking to do something similar.
Progressively Enhancing HTML5 Forms
Add a Comment
Does anyone know of a way that I can effectively disable or unload a script if input type="date" is supported?
I'm doing a design right now that I'm using datepicker.js for a dropdown to select a start and finish date for staying at a country house.
However, I would like to use the built in date picker that comes on iOS and other browsers.
Is there a way to disable the javascript that creates the drop down gallery if the device supports input type="date" natively?
Linky here: Contact Page
Progressively Enhancing HTML5 Forms