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?

Was it helpful?

Solution

Your url either needs to be relative (e.g. '/reports/') or fully qualified with http://

reporturl="http://localhost:3000/reports/"+suggestion.data;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top