javascript中的重定向url
我有使用devbridge包开发的自动完成代码 我无法重定向到urljavascript中的重定向url,javascript,href,window.location,Javascript,Href,Window.location,我有使用devbridge包开发的自动完成代码 我无法重定向到url $('#search_box').autocomplete({ lookup: arr, onSelect: function (suggestion) { reporturl="localhost:3000/reports/"+suggestion.d
$('#search_box').autocomplete({
lookup: arr,
onSelect: function (suggestion) {
reporturl="localhost:3000/reports/"+suggestion.data;
console.log(reporturl);
window.location= reporturl;
}
});
},'json');
我无法重定向,为什么?您的url需要是相对的(例如,/reports/),或者完全符合http://
reporturl=”http://localhost:3000/reports/“+建议.数据代码>您的url需要是相对的(例如“/reports/”),或者完全符合http://
reporturl=”http://localhost:3000/reports/“+建议.数据代码>您的url需要是相对的(例如“/reports/”),或者完全符合http://
reporturl=”http://localhost:3000/reports/“+建议.数据代码>您的url需要是相对的(例如“/reports/”),或者完全符合http://
reporturl=”http://localhost:3000/reports/“+建议.数据代码>