I was using this code earlier today and it worked fine, then I apparantly changed something and it doesnt work. ive tried reinstalling jQueryUI but it doesnt help.
<script type="text/javascript">
$(function() {
function loadpage(webpage) {
window.location.replace( webpage );
}
$("#searchform").autocomplete({
source: "search.php",
minLength: 2,
select: function(event, ui) {
loadpage(ui.item ? ("http://www.tf2heatmaps.net/maps/" + ui.item.value + "/"));
}
});
});
</script>
<div class="ui-widget">
<label for="searchform">Search: </label>
<input id="searchform" class="textbox">
</div>
search.php returns valid JSON so I don't believe the problem is there.