most browsers support JSON.parse
Don't use `$` for variables (conflict w jquery)
use jQuery hasClass
use jQuery in more places