table to json

table to json demo. works, but only in an alert() atm.