Javascript String to_json()

Description

Javascript String to_json()


String.prototype.to_json = function () {
  try {/*from   www .ja v  a 2s  . co  m*/
    return JSON.parse(this.valueOf());
  } catch (ex) {
    return this.valueOf();
  }
};



PreviousNext

Related