[Answer]-Django Ajax Values Returned but Not Being Displayed in Drop-down List

1👍

I dont know how necessary this is since it was a typographical error rather than a logical one and probably wont apply to many people, so for the next person who comes along, this probably isn’t the solution you’re looking for, but it might be a good lesson. Whenever you’ve looked everywhere for a bug and you’re sure you’ve done everything right, take a break. Come back later with fresh eyes. The problem is never where you think it is.

In this case, he was missing the A in his searchSuccess() definition where $('#serch-results') should have been$('search-results).

edit: also, on django’s development server i’ve run into problems with ajax and one or two other functions where changes in code stop taking effect. Sometimes you have to restart the server, the terminal, or the entire machine(I suggest in that order)

Leave a comment