Could someone give me a hand with a very simple ajax problem? I want to post some data and have the server just return a small snippet of html, which I then want to insert into my dom at a particular id.
Let's say the html snippet to be returned is just a string: <p>hello world</p>. Does my views.py function just return it like this? return HttpResponse("<p>hello world</p>") I have some jquery on client side that is just trying trying to have the callback function throw the returned snippet up in an alert box, like this: <input type="submit" onclick="$(.post({% get_my_url %}, $ ('id_comment').val(), function(data) { alert(data);}); return false; " /> I find that I never hit my callback function (the alert(data)). Instead the browser just replaces my with a page containing <html><head><body>hello</body></html> Could someone give me a pointer as to what I'm doing wrong? Margie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---