0

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?

1 Answer 1

3

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

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.