Note that there are some explanatory texts on larger screens.

plurals
  1. POXMLHttpRequest of Linkedin API url returns null
    text
    copied!<p>In my javascript application i want to perform a people search on Linkedin. Since this search has to work without a user having to login to Linkedin, i'm using a javascript OAuth library and my Linkedin api key, secret key, oauth token and oauth secret token to generate a api url. This url looks like this:</p> <p><a href="http://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,picture-url,location))?first-name=John&amp;last-name=Smith&amp;count=4&amp;format=json&amp;oauth_consumer_key=XXX&amp;oauth_token=XXX&amp;oauth_version=1.0&amp;oauth_timestamp=XXX&amp;oauth_nonce=XXX&amp;oauth_signature_method=HMAC-SHA1&amp;oauth_signature=XXX" rel="nofollow">http://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,picture-url,location))?first-name=John&amp;last-name=Smith&amp;count=4&amp;format=json&amp;oauth_consumer_key=XXX&amp;oauth_token=XXX&amp;oauth_version=1.0&amp;oauth_timestamp=XXX&amp;oauth_nonce=XXX&amp;oauth_signature_method=HMAC-SHA1&amp;oauth_signature=XXX</a></p> <p>When i directly enter the url in my browser, it provides the results i want. However, performing a javascript XMLHttpRequest of this url always returns null. In my opinion, this indicates that there must be a problem with cross-domain policy. Yet, as i have added my domain to my Linkedin app's javascript api domains, i thought no cross-domain problems would occur.</p> <p>Can anybody tell me what is the problem here?</p> <p>PS: This is the javascript code for the XMLHttpRequest:</p> <pre><code>var xhr=new XMLHttpRequest(); xhr.open("GET",url,true); // url = valid url like the one above xhr.onreadystatechange=function() { if (xhr.readyState===4) { alert(xhr.responseText); // returns null } }; xhr.send(null); </code></pre>
 

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