diff --git a/js/search.js b/js/search.js index b61f3f3..3c8afcf 100644 --- a/js/search.js +++ b/js/search.js @@ -7,18 +7,20 @@ var fnFormatSearchResult = function(value, data, currentValue) { return ' ' + listing; }; -$('input.search').autocomplete({ - minChars:2, - maxHeight:400, - fnFormatResult: fnFormatSearchResult, - onSelect: function(value, data){ - if (window.location.host == 'master.php.net') { - window.location = "/manage/users.php?username=" + users[value]["username"]; - } else { - window.location = "/" + users[value]["username"]; - } - }, - lookup: lookup +$(document).ready(function() { + $('input.search').autocomplete({ + minChars:2, + maxHeight:400, + fnFormatResult: fnFormatSearchResult, + onSelect: function(value, data){ + if (window.location.host == 'master.php.net') { + window.location = "/manage/users.php?username=" + users[value]["username"]; + } else { + window.location = "/" + users[value]["username"]; + } + }, + lookup: lookup + }); }); // vim: set expandtab shiftwidth=4 softtabstop=4 tabstop=4 :