On Monday, March 7, 2011 3:32:51 PM UTC-8, Rami wrote:
>
> Thanks Andy!
>
> 1- you were correct about the form submitting the get method.
>
> 2- As you mentioned, the when I change the  if statement to 
> "request.GET.has_key('ajax')", it gets executed. the "?ajax" apparently 
> causes the statement to be interpreted as a GET (I didn't know that)
>
> The only reason I had the '/?ajax' in my syntax is because I was following 
> a tutorial that was for a get method. 
>

A clarification: the method is still POST. But it is possible to have both 
POST and GET data in the same request, which is what you've done here - data 
appended after the question-mark in a URL is GET, but the other data you're 
submitting is POST.
 

> Question:
>
> What is the difference between passing data variables to the server in the 
> URL vs in the [data] category of the the post method?
>
> i.e. having '/?ajax&id=' + $(this).attr('id') vs  id: $(this).attr('id')
>

As I say above, those appended to the URL are GET, and the others are POST. 
Practically speaking, for an AJAX request it makes very little difference, 
although good practice is still to use POST for actions that make changes 
(ie update the database).
--
DR. 

>  
>
 

-- 
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.

Reply via email to