I suggest you ...

escape data on back end, eg. apostrophe in one's name

Hello,

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
...getElementById('authorFname2').value='D'Ann';window.opener.document.getElementBy…

Can you please escape such characters on the back end for any fields? (first name, last name, institution, bio, etc.)

Thanks,
Lisa

6 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    lisalisa shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    under review  ·  ORCID SupportAdminORCID Support (ORCID Support Team, ORCID) responded  · 

    Hi,

    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.

    Best,
    -Catalina
    ORCID Support

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Anonymous commented  ·   ·  Flag as inappropriate

        Hi Catalina,

        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.

        Thanks!

      Feedback and Knowledge Base