diff --git a/docs/api/methods.html b/docs/api/methods.html index cb62c63e..4df918d5 100755 --- a/docs/api/methods.html +++ b/docs/api/methods.html @@ -150,7 +150,6 @@ $.mobile.loadPage( "searchresults.php", {
· Arguments:
See jQuery's data and removeData methods
- Note: Calling jqmData() with no argument will return undefined. This behavior is subject to change in future versions.
· Also:
When finding elements by their jQuery Mobile data attribute, please use the custom selector :jqmData(), as it automatically incorporates namespaced data attributes into the lookup when they are in use. For example, instead of calling $("div[data-role='page']"), you should use $("div:jqmData(role='page')"), which internally maps to $("div[data-"+ $.mobile.ns +"role='page']") without forcing you to concatenate a namespace into your selectors manually.
diff --git a/js/jquery.mobile.core.js b/js/jquery.mobile.core.js index f566dc9c..bd30b2ff 100644 --- a/js/jquery.mobile.core.js +++ b/js/jquery.mobile.core.js @@ -128,11 +128,7 @@ // Mobile version of data and removeData and hasData methods // ensures all data is set and retrieved using jQuery Mobile's data namespace $.fn.jqmData = function( prop, value ) { - var result; - if ( typeof prop != "undefined" ) { - result = this.data( prop ? $.mobile.nsNormalize( prop ) : prop, value ); - } - return result; + return this.data( prop ? $.mobile.nsNormalize( prop ) : prop, value ); }; $.jqmData = function( elem, prop, value ) {