Daniel is right. The only way your code will work is if you've set up your argument to load() to be caught by urls.py.
Also, in your case, it seems like your argument to load() is a mix of URL and CSS selector... Make sure you're using a URL there.
Check out my blog for a very basic tutorial on getting AJAX to work in Django:
http://joelinux117.blogspot.com/2011/11/making-ajax-calls-in-django-using-dojo.html
It's using Dojo, but the same principle applies with jQuery (just make sure where the tutorial calls a URL, you're passing the URL as an argument to load().
--
Joey Espinosa
Software Engineer
http://about.me/joelinux
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/3CzEsK5NobAJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Btw, disregard what I said about mixing URL and CSS selectors. I forgot that load() can do that (I usually use ajax() or get()/post(), neither of which supports that). MY BAD!
--
Joey Espinosa
Software Engineer
http://about.me/joelinux
Thanks, I tried to stay clear of posting code because I've tried maybe
20 different ways and nothing seems to work. I have used the {% url %}
tag and yesterday competed - a 'ajax_user_search' tut using django Q
still no luck. This was the load call:
$( document ).ready( function() {
$( '#searchSubmit' ).click( function() {
q = $( '#q' ).val();
$( '#results' ).html( ' ' ).load(
'{% url userbase_user_search %}?q=' + q );
});
});
Upon setting everything up and clicking the tag, nothing happens as
usual. I'm going to try the tut posted below with high hopes - and I
am considering trying 'djaxice'