Skip to content

Instantly share code, notes, and snippets.

@DragorWW
Created January 23, 2014 12:48
Show Gist options
  • Save DragorWW/8577985 to your computer and use it in GitHub Desktop.
Save DragorWW/8577985 to your computer and use it in GitHub Desktop.
input file not work in iOS <6 check
var isFileInputSupported = (function () {
// Handle devices which falsely report support
if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) {
return false;
}
// Create test element
var el = document.createElement("input");
el.type = "file";
return !el.disabled;
})();
if (!isFileInputSupported) {
$('html').addClass('no-inputfile');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment