autocomplete gold release 4
Posted: Mon Mar 04, 2013 5:50 pm
Autocomplete is added to Gold release 3, I got Gold release 4 and tried to explore what's like. Nothing happeded when enter suggest into search bar no matter how many characters were put in. I checked simplesearch.ascx and found this
I guess this is for autocomplete but why it like not turned on.
much appreciated if anyone who used it can have a hint.
Code: Select all
<script type="text/javascript">
$(function () {
$(".searchPhrase").autocomplete({
source: function (request, response) {
$.ajax({
url: "Search.aspx/Suggest",
data: "{ 'term': '" + request.term + "' }",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },
success: function (data) {
response($.map(data.d, function (item) {
return {
value: item
}
}))
},
});
},
minLength: 2
});
});
</script>
much appreciated if anyone who used it can have a hint.