Thehotfix.net Logo                            To the forums            

How To Do A AJAX Feedback Mechanism

One thing that I have always tried to solicit as much as possible is user feedback. For example, when a user signs up for Toronto, they get a personalized email from me, complete with my actual email address. I want to make it as easy as possible to give feedback.

So a few weeks ago I was thinking how people are using our site, but I have no clue what their feelings are. Are the results good? Great? Craptastic? Repeat visitors are not a good measurement either - I used to visit Toronto.com a lot, but only because they were really the only game in town. Did I like their site? Not really ... but I kept coming back out of necessity.

So we set out to build a quick and easy feedback mechanism. A little floater/popup that lets you quickly rate a page. All AJAX driven of course.

Nicely packaged (it requires minimal HTML editing, and can be fully manipulated through CSS) I give you: AJAX Feedback Mechanism.

On pageload, the JS is executed through an onload statement inside the tag. It finds the proper div (in this case feedback_wrapper) and puts in the HTML there. Then as the person browses around the page, it hovers gently in the bottom right.

Open hovering over, it opens up a little dialog box (which you can control through feedback.css).

Upon clicking on a rating, the AJAX comes into play - the user response is sent to feedback.php, the entry is stored, and a thank you message is given. A cookie is also set so that the feedback system won't show again (in the case of the demo this is disabled).

Quick links for those that skim through posts:

Demo: click here
Download: click here

Thanks to Jayson for his great work in getting exactly what we needed.