I have the following JQuery AJAX call that sends HTML form data to my server side script to deal with. However I currently find line breaks and convert them to <br /> for display in another part of my application. I now need to make sure I am stripping out apostrophes however I am not confident on how to replace multiple characters in one go.
This is the JQuery I use currently before adding this into my AJAX.
description = $("#description").val().replace(/\n/g, '<br />');
Can anyone point me in the right direction?
Thanks
You don’t have to do it in one go in the sense of one call to
.replace(), just chain multiple.replace()calls:(Or replace with
'''or'''if that’s what you need…)