trying to pass JSON as variable to javascript