escape data on back end, eg. apostrophe in one's name
We are having problem passing data back to our site, because there's an apostrophe in the user's name (D'Ann Finley), this making it think it's end of statement. We are getting the following error:
SyntaxError: missing ; before statement
Can you please escape such characters on the back end for any fields? (first name, last name, institution, bio, etc.)
I’m not exactly sure how you’re getting this response- can you provide me with more information about what you are trying to do and how you are doing it? In general we recommend calling data with our API and data is all correctly escaped using JSON with the API (see http://support.orcid.org/knowledgebase/articles/132271-retrieving-data-with-the-public-api).
Also it looks like from the line: getElementById(‘authorFname2’).value=’D’Ann’ that you are grabbing “D’Ann” correctly but are failing to correctly escape the value when you generate their webpage on their server.
If you can let me know more about what you’re doing I can try and follow up with more information.
We are using json when searching for users. We select the user we want which will then populate back onto our site, and thus the "getElementById(‘authorFname2’)" that you saw. But in this case if you search for "Finley" (last name), one of the results is "D'Ann Finley". That's who we want and the apostrophe in her name is breaking the code and there looks to be no way to escape it on our end.