Skip to content

Instantly share code, notes, and snippets.

@NOEinteractive
Created October 14, 2013 07:43
Show Gist options
  • Save NOEinteractive/6972206 to your computer and use it in GitHub Desktop.
Save NOEinteractive/6972206 to your computer and use it in GitHub Desktop.
Placeholder polyfill with yepnope
//si le browser ne supporte pas l'attribut placeholder,
//ce JS va charger un polyfill et l'appliquer sur tous les inputs de la page
//https://github.com/mathiasbynens/jquery-placeholder
yepnope({
test:'placeholder' in document.createElement('input'),
nope: namespace.themeUrl+'/js/libs/jquery.placeholder.js',
callback: function(url, result, key) {
$.fn.placeholder && $('input').placeholder();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment