Thanks.. ---------------------------------------------------------- > -----Ursprüngliche Nachricht----- > Von: [email protected] [mailto:rubyonrails- > [EMAIL PROTECTED] Im Auftrag von Diodeus > Gesendet: Mittwoch, 16. Januar 2008 20:44 > An: Ruby on Rails: Spinoffs > Betreff: [Rails-spinoffs] Re: is there something like addslashes and > stripslashes in prototype > > > No, but Javascript does. > > On Jan 16, 1:47 pm, "Andreas Franke" <[EMAIL PROTECTED]> wrote: > > if i would save the content of a textarea into mysql i eventually have > to > > mask things like ,"/\ and so on. > > > > in php there are the add- and stripslashes functions you could use. > > > > is there somthing compareable like this in the string object of > prototype? > > if not, it would very nice to have, i think. > > > > function addslashes(str) { > > str=str.replace(/\'/g,'\\\''); > > str=str.replace(/\"/g,'\\"'); > > str=str.replace(/\\/g,'\\\\'); > > str=str.replace(/\0/g,'\\0'); > > return str;} > > > > function stripslashes(str) { > > str=str.replace(/\\'/g,'\''); > > str=str.replace(/\\"/g,'"'); > > str=str.replace(/\\\\/g,'\\'); > > str=str.replace(/\\0/g,'\0'); > > return str; > > > > } > > > > Andreas >
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
