How can I simplify this code? if necessary, I can rename the .php files to the same exact name as the ID element, so $("#locus") can use /js/zip/"id element".php or whatever. It is only if it helps.
<script type="text/javascript"> $().ready(function() { $("#locus").autocomplete("/js/zip/us.php", { matchContains: true, matchFirst: true, mustMatch: false, selectFirst: false, cacheLength: 10, minChars: 1, autofill: false, scrollHeight: 150, width: 185, max: 20, scroll: true }); $("#locca").autocomplete("/js/zip/ca.php", { matchContains: true, matchFirst: true, mustMatch: false, selectFirst: false, cacheLength: 10, minChars: 1, autofill: false, scrollHeight: 150, width: 185, max: 20, scroll: true }); $("#locuk").autocomplete("/js/zip/uk.php", { matchContains: true, matchFirst: true, mustMatch: false, selectFirst: false, cacheLength: 10, minChars: 1, autofill: false, scrollHeight: 150, width: 185, max: 20, scroll: true }); $("#locau").autocomplete("/js/zip/au.php", { matchContains: true, matchFirst: true, mustMatch: false, selectFirst: false, cacheLength: 10, minChars: 1, autofill: false, scrollHeight: 150, width: 185, max: 20, scroll: true }); $("#locie").autocomplete("/js/zip/ie.php", { matchContains: true, matchFirst: true, mustMatch: false, selectFirst: false, cacheLength: 10, minChars: 1, autofill: false, scrollHeight: 150, width: 185, max: 20, scroll: true }); $("#locot").autocomplete("/js/zip/ot.php", { matchContains: true, matchFirst: true, mustMatch: false, selectFirst: false, cacheLength: 10, minChars: 1, autofill: false, scrollHeight: 150, width: 185, max: 20, scroll: true }); }); </script>