m3avrck
December 29th, 2006, 02:58 PM
Right now Plaxo returns emails in the format:
"john doe" <john@doe.com>
While this is standard format, it isn't useful in all cases. For instance, the best format for me would be just a comma separated list of email addresses only. And I'm not the only one, Google that for my people looking to do the same :-)
What if Plaxo's showPlaxoABChooser() had a 3rd parameter to distinguish the *format* of emails returned? Standard, just emails, etc... that would make it much more useful in my opinion.
Till then, here is some JS parsing code I wrote (would be cleaner if I could use jQuery, *wink*) that does just this:
function onABCommComplete() {
// grab all of the emails from Plaxo
// ADJUST TO POINT TO YOUR TEXTAREA
var emails = document.forms[1].elements[0].value;
// strip out all of the names associated with emails
emails = emails.match(/<([^>]+)>/g).join(', ');
// strip out the opening and closing brackets
emails = emails.replace(/[<>]/g,'');
// ADJUST TO POINT TO YOUR TEXTAREA
document.forms[1].elements[0].value = emails;
}
"john doe" <john@doe.com>
While this is standard format, it isn't useful in all cases. For instance, the best format for me would be just a comma separated list of email addresses only. And I'm not the only one, Google that for my people looking to do the same :-)
What if Plaxo's showPlaxoABChooser() had a 3rd parameter to distinguish the *format* of emails returned? Standard, just emails, etc... that would make it much more useful in my opinion.
Till then, here is some JS parsing code I wrote (would be cleaner if I could use jQuery, *wink*) that does just this:
function onABCommComplete() {
// grab all of the emails from Plaxo
// ADJUST TO POINT TO YOUR TEXTAREA
var emails = document.forms[1].elements[0].value;
// strip out all of the names associated with emails
emails = emails.match(/<([^>]+)>/g).join(', ');
// strip out the opening and closing brackets
emails = emails.replace(/[<>]/g,'');
// ADJUST TO POINT TO YOUR TEXTAREA
document.forms[1].elements[0].value = emails;
}