PDA

View Full Version : How It's Done....AJAX?




SChaput
Oct 12, 2009, 07:15 PM
I'm curious as to how the website, http://www.textsfromlastnight.com handles their rating scale.

When your on any given page you can click "good night" or "bad night" depending on your vote it increments by one and doesn't let you vote on that particular post again.

Is this done by using AJAX? combined with a mysql database, using cookies and IP's to block repeat voters?

Thanks.



angelwatt
Oct 12, 2009, 09:07 PM
Yea, it looks like it's a mix of those things. Can't tell for certain if they have a DB on the backend, but that's the usual case for this type of thing. Blocking repeats could be done few ways, through JavaScript, Sessions, Cookies, etc.

nuxx
Oct 13, 2009, 02:56 AM
Firebug doesn't show any XMLHttpRequest objects, so whatever else it's using I doubt it's using pure AJAX.

Mitthrawnuruodo
Oct 13, 2009, 03:03 AM
They are calling some ajax functions: http://static.textsfromlastnight.com.s3.amazonaws.com/postings.js

Possibly through some 3rd party framework...

SChaput
Oct 19, 2009, 05:59 PM
Thanks for showing me the rateup and ratedown functions, I also saw those looking through the code.
What is this type of thing called? I'd like to implement something like this, using a mysql database as the backend, as well as some php and maybe JavaScript? But I'm not exactly sure what sort of tutorials I need.

Any help is appreciated. Thanks.

SrWebDeveloper
Oct 20, 2009, 01:02 PM
Firebug doesn't show any XMLHttpRequest objects, so whatever else it's using I doubt it's using pure AJAX.

Ajax does not require that object to make it Ajax. Here's an example (http://www.devpapers.com/article/328) using PHP and Javascript without referencing that specific object.

-jim