[Answer]-Jquery auto suggest with ajax and django

1👍

You have a syntax error here:

data: { 'keyword':$('#id_q').val(), 'page' = 'searchbox'},

It should be

data: { 'keyword':$('#id_q').val(), 'page': 'searchbox'},

And this makes no sense:

response (data.autosuggest)

What are you trying to do there? Do you mean return data.autosuggest?

Plus you probably don’t want to be rendering a template for the Django response – it should just be JSON. You should at least post the contents of ‘widgets/searchbox.html’.

Leave a comment