Your url either needs to be relative (e.g. '/reports/') or fully qualified with http://
reporturl="http://localhost:3000/reports/"+suggestion.data;
Question
I have the autocomplete code developed using devbridge package
I'm not able to redirect to url
$('#search_box').autocomplete({
lookup: arr,
onSelect: function (suggestion) {
reporturl="localhost:3000/reports/"+suggestion.data;
console.log(reporturl);
window.location= reporturl;
}
});
},'json');
I'm unable to redirect,why?
Solution
Your url either needs to be relative (e.g. '/reports/') or fully qualified with http://
reporturl="http://localhost:3000/reports/"+suggestion.data;