Javascript Bug in Simple Search Conlib
Posted: Wed Jul 03, 2013 9:50 am
I found a bug in the RC5 Simple Search conlib.
See comment in code below:
I recently upgraded to RC5 from RC4 Gold but I'm not sure if I was also getting this error when on RC4.
Hope this helps someone else.
See comment in code below:
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
}
}))
},
}); // I GET ERROR MESSAGE HERE: "Expected Identifier or String" - The corrective action is to remove the comma in the line above this one.
},
minLength: 2
});
});
</script>
Hope this helps someone else.