Encode values in javascript parameters to prevent possible injection.