Note that there are some explanatory texts on larger screens.

plurals
  1. POFetching results from LinkedIn API through javascript
    primarykey
    data
    text
    <p>First of all thank you for reading this. I am having some trouble fetching the data given by the Linkedin sign-in API with javascript. Here is the script:</p> <pre><code> &lt;script type="text/javascript"&gt; function onLinkedInAuth() { IN.API.Profile("me").fields(["firstName","lastName","headline","summary","location","educations","skills"]).result(displayProfiles); } function displayProfiles(profiles) { member = profiles.values[0]; document.getElementById("name").value = member.firstName +" "+ member.lastName; document.getElementById("pos").value = member.headline; document.getElementById("city").value = member.location.name; document.getElementById("sum").value = member.summary; var i=0; do { var oldHTML = document.getElementById('para').innerHTML; var newHTML = oldHTML + "&lt;tr&gt;&lt;td&gt;" + member.educations.values[i].schoolName + "&lt;/td&gt;&lt;/tr&gt;"; document.getElementById('para').innerHTML = newHTML; i++; } while(i&lt;=1); var v=0; do { var oldHTML = document.getElementById('tara').innerHTML; var newHTML = oldHTML + "&lt;tr&gt;&lt;td&gt;" + member.skills.values[v].skill.name + "&lt;/td&gt;&lt;/tr&gt;"; document.getElementById('tara').innerHTML = newHTML; v++; } while(member.skills.values[v].skill.name); document.getElementById("educ").value = member.educations.values[1].schoolName; document.getElementById("skills").value = member.skills.values[0].skill.name; } &lt;/script&gt; </code></pre> <p>It's a very basic script to get the user infos and, among it, the educational and professional background of the user. The thing is that member.educations.values[i].schoolName and member.skills.values[v].skill.name can have multiple values and I want to gather them all. </p> <p>It works as long as the specified fields are not empty but then it outputs an error saying that member.skills.values[v] is undefined and it does not run the second loop.</p> <p>I know the error is really basic but I'm not that great in javascript. </p> <p>Thanks for your help anyways, have a good day!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload