morph/sanitize data  for javascript