View Single Post
Old 27-01-2008, 12:35   #1 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
let's talk about ajax, baby

So, I've been slowly learning all about the wonders of JavaScript and the DOM.

Now, I'm focusing my attention on Ajax (via Jeremy Keith's book "Bulletproof Ajax") because most Front-End Developer jobs I see advertised want some Ajax knowledge.

Let's talk about Ajax in general, its implementation, concepts, etc.

We'll start the conversation here:

I am, however, having a hard time conceptually with it. He mentions something about using the "open" method - as in, XMLHttpRequest.open("POST", "something.ext", true); - and how when you are sending data to the server it should always use POST and when you're retrieving data from the server, use GET. Fine.

Then I was thinking about my recent changes to spoetic.com, wherein I added a ratings system that uses GET to update a database. This seems like a grey area to me because GET can be used to send data as well. In the case of these ratings, it's sending the query string - ?action=rate&id=XX&rating=Y (rewritten to "/rate/XX/Y/" by mod_rewrite).

So, what's the deal? Should I be using POST even when GET works as in this example?

(Spoetic is not using Ajax right now. I may re-engineer it to be more modular so that I can once I figure this all out.)
  Reply With Quote