function encodeVal(val) {
  val = encodeURIComponent(val);
  val = val.replaceAll('!', '%21');
  val = val.replaceAll('(', '%28');
  val = val.replaceAll(')', '%29');
  val = val.replaceAll('\'', '%27');
  val = val.replaceAll('%22', '"');
  return val;
}
/**
 * encodeURIComponent isn't perfect, so additional characters are encoded along
 * with its output. Makes the given string safe for use in URIs / URLs
 * @param {string} val the value to encode
 * @returns an encoded value
 */
encodeURIComponent isn't perfect, so additional characters are encoded along
with its output. Makes the given string safe for use in URIs / URLs
@param {string} val the value to encode
@returns an encoded value
encodeURIComponent isn ' t perfect so additional characters are encoded along with its output . Makes the given string safe for use in URIs / URLs @param { string } val the value to encode @returns an encoded value
function encodeVal(val) {
  val = encodeURIComponent(val);
  val = val.replaceAll('!', '%21');
  val = val.replaceAll('(', '%28');
  val = val.replaceAll(')', '%29');
  val = val.replaceAll('\'', '%27');
  val = val.replaceAll('%22', '"');
  return val;
}
function encodeVal ( val ) { val = encodeURIComponent ( val ) ; val = val . replaceAll ( '!' , '%21' ) ; val = val . replaceAll ( '(' , '%28' ) ; val = val . replaceAll ( ')' , '%29' ) ; val = val . replaceAll ( '\'' , '%27' ) ; val = val . replaceAll ( '%22' , '"' ) ; return val ; }
encodeURIComponent isn't perfect, so additional characters are encoded along
 with its output.
encodeURIComponent isn ' t perfect so additional characters are encoded along with its output .