AJAX for feedback
March 7, 2006
/ Filed under: JavaScript, Web Development
I’ve recently implemented an AJAX approach for leaving feedback, at this site (for no other reason than getting practice with using AJAX). When you leave feedback, the page will still reload, but it’s all done through JavaScript, now. I am glad I got this to work, because I was initially struggling to figure out how to "POST" data via the It turns out it’s almost identical to using the "GET" approach, except you specify the Request Header:
I’m not even sure this is the "right" way to specify this, but it seems to work great. Another tricky part to using "POST" is that you still have to submit a query string, with matching name/value pairs, much like the "GET" approach in the URL:
So... even if you are "posting" a giant textarea (such as feedback), it still gets "appended" to the query string. Anyway, hopefully it works OK. I think I’ve worked through all the kinks. You can see the JavaScript here.
Comments/Mentions
|
Editor Picks
Email NewsletterSubscribe to the digest newsletter to receive posts by email: Recent Comments
Advertisements
|