Javascript String add_slashes()
slashes()
String.prototype.add_slashes = function() { var string = this; string = string.replace(/\\/g,"\\\\"); string = string.replace(/\'/g,"\\'"); string = string.replace(/\"/g,"\\\""); return string;// w w w . j av a 2s. com }