JSFiddle - React, Tailwind, and code Playground
JavaScript
/* https://github.com/appendto/amplify/blob/3e411238b2bae9e4e92ebcdf85925d8ae73927ae/src/store.js#L146
*/
var div = document.createElement( "div" ),
attrKey = "amplify";
div.style.display = "none";
document.getElementsByTagName( "head" )[ 0 ].appendChild( div );
// we can't feature detect userData support
// so just try and see if it fails
// surprisingly, even just adding the behavior isn't enough for a failure
// so we need to load the data as well
try {
div.addBehavior( "#default#userdata" );
div.load( attrKey );
} catch( e ) {
div.parentNode.removeChild( div );
alert("failed adding userdata element");
}
//-------------------
try {
$('[type=something]');
alert('no error');
} catch ( x ) {
alert( x.message );
}