You are only checking for a side requirement that you could more easily do when extending the selector to "input.value" instead of really looking for the "autocomplete" function.

The jQuery method also always returns a jQuery object that is a collection of found DOM nodes. If that jQuery object doesn't have an "autocomplete" method, then the autocompete JQuery UI implementation havn't been loaded correctly. The problem seems to be somewhere else.

Here's the reference: http://api.jqueryui.com/autocomplete/
Normally, there's no need to check for that.