MCPcopy Index your code
hub / github.com/sql-js/sql.js / dataAttr

Function dataAttr

documentation/javascript/application.js:2700–2729  ·  view source on GitHub ↗
( elem, key, data )

Source from the content-addressed store, hash-verified

2698});
2699
2700function dataAttr( elem, key, data ) {
2701 // If nothing was found internally, try to fetch any
2702 // data from the HTML5 data-* attribute
2703 if ( data === undefined && elem.nodeType === 1 ) {
2704
2705 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
2706
2707 data = elem.getAttribute( name );
2708
2709 if ( typeof data === "string" ) {
2710 try {
2711 data = data === "true" ? true :
2712 data === "false" ? false :
2713 data === "null" ? null :
2714 // Only convert to a number if it doesn't change the string
2715 +data + "" === data ? +data :
2716 rbrace.test( data ) ? jQuery.parseJSON( data ) :
2717 data;
2718 } catch( e ) {}
2719
2720 // Make sure we set the data so it isn't changed later
2721 jQuery.data( elem, key, data );
2722
2723 } else {
2724 data = undefined;
2725 }
2726 }
2727
2728 return data;
2729}
2730
2731// checks a cache object for emptiness
2732function isEmptyDataObject( obj ) {

Callers 1

application.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…