I have the following code:
var requestUri = webAbsUrl + "/_api/web/Lists/getByTitle('Staff Directory')/Items?$\ filter=Title eq '" + currentUserEmail + "'&$\ select=*";
It works until it encountered an employee with an apostrophe in the last name. I tried encodeURI() and encodeURIComponent() but neither worked. I tried searching online and can't seem to find a quick solution.
Example Email: John.O'Doe@domain.com