( elem, key, data )
| 1929 | }); |
| 1930 | |
| 1931 | function dataAttr( elem, key, data ) { |
| 1932 | // If nothing was found internally, try to fetch any |
| 1933 | // data from the HTML5 data-* attribute |
| 1934 | if ( data === undefined && elem.nodeType === 1 ) { |
| 1935 | |
| 1936 | var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); |
| 1937 | |
| 1938 | data = elem.getAttribute( name ); |
| 1939 | |
| 1940 | if ( typeof data === "string" ) { |
| 1941 | try { |
| 1942 | data = data === "true" ? true : |
| 1943 | data === "false" ? false : |
| 1944 | data === "null" ? null : |
| 1945 | jQuery.isNumeric( data ) ? parseFloat( data ) : |
| 1946 | rbrace.test( data ) ? jQuery.parseJSON( data ) : |
| 1947 | data; |
| 1948 | } catch( e ) {} |
| 1949 | |
| 1950 | // Make sure we set the data so it isn't changed later |
| 1951 | jQuery.data( elem, key, data ); |
| 1952 | |
| 1953 | } else { |
| 1954 | data = undefined; |
| 1955 | } |
| 1956 | } |
| 1957 | |
| 1958 | return data; |
| 1959 | } |
| 1960 | |
| 1961 | // checks a cache object for emptiness |
| 1962 | function isEmptyDataObject( obj ) { |
no outgoing calls
no test coverage detected
searching dependent graphs…