问题
I moved to jQuery UI 1.9 and have some problems with Autocomplete control. As written here they added option called messages
that actually shows "No results" or results count information under the control. The problem that I can't any info about its behaviour find in the manuals.
How can I disable that option? Thank you
回答1:
Indeed not in the API documentation to the date of my answer... You can customize it this way:
jQuery(...).autocomplete({
messages : {
noResults : 'No results found.',
results : function(count) {
return count + (count > 1 ? ' results' : ' result ') + ' found';
}
},
});
NOTE: As commented by user actimel, customising is ok but do not hide it as it is part of the accessibility feature (blind users for example).
回答2:
I have been digging around this a bit and found the following:
The message is part of jQuery UI accessibility functionality and is actually never supposed to be shown (visible) and only processed by screen-readers.
All your problems will go away if you use some of the jQuery UI stylesheet files that will hide these elements for you.
来源:https://stackoverflow.com/questions/13283272/autocomplete-experimental-messages-option-no-results