Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Those pesky quotation marks

$
0
0
For a directory, I'm attempting to retrieve names and data beginning with their email address. Two addresses--both with single quotes--elude me. I've tried everything I can think of, but nothing has worked. Any ideas?
        ...
        var arFolks = ["O'KeeffePM@some.org", "O'DonoghueDW@some.org"];
        ...
        for(var l=0; l<arFolks.length; l++) {
            strUser = arFolks[l];
            getLoginFromEmail(strUser);
        }
        ...
        function getLoginFromEmail(email) {
//          var whatever = email.replace(/'/g,"\'");    //nothing tried here has helped
            ...
            var promiseEmail = $().SPServices({
                operation: "GetUserLoginFromEmail",
                emailXml: "<Users><User Email=" + email + " /></Users>" 
            });
            promiseEmail.done(function() {
                ...
            });
            promiseEmail.fail(function() {
                alert("Whoops! Failed to retrieve logon from email: " + email);
            });
        }

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>