1👍
You need a ;
at the end of this:
$.ajax({
type: 'GET',
url: '{% url "search.views.search" inputString="xyz" %}'.replace("xyz", inputString.toString()),
dataType: 'json',
success: function(search_results){
suggestions = JSON.parse(JSON.stringify(search_results));
alert(suggestions[0].name);
}
});
0👍
same conclusion 🙂
you missed a semicolon ;
jslint could help you to find this kind of errors : http://www.jslint.com/
function lookup(inputString) {
if (inputString.length === 0) {
$('#suggestions').empty().fadeOut();
}
else {
$.ajax({
type: 'GET',
url: '{% url "search.views.search" inputString="xyz" %}'.replace("xyz", inputString.toString()),
dataType: 'json',
success: function(search_results) {
suggestions = JSON.parse(JSON.stringify(search_results));
alert(suggestions[0].name);
}
});
}
}
- [Answer]-Show related model info in Django form
- [Answer]-Using Django Users for all logged in users, and registering them
Source:stackexchange.com