code: function jpescape(s) {
      s = s.split('~').join('~0');
      s = s.split('/').join('~1');
      return s;
  }
docs: escapes JSON Pointer using ~0 for ~ and ~1 for /
  @param s the string to escape
  @return the escaped string