I’m implementing a voting system like the one used by stackoverflow. It’s working with ajax sending POST request to an url. I’d like a way to fail gracefully when javascript/ajax isn’t supported or enabled, a GET like /voteup/id isn’t even considered because i’m altering the database.
What’s the best solution? I’m either considering a form or simply removing the feature if js isn’t enabled.
There are at least three related entries on SO but i can’t insert more than one hyperlink
Make the basic voting actions mini-forms, then use javascript to disable their posting action.
To replace these with links for javascript-enabled users:
I haven’t tested the above. If you’re using jQuery or some other framework, there will be more elegant ways of doing all of this.