Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript variable not able to display in HTML file
    primarykey
    data
    text
    <p>Take a look at my code :</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Profile App Example&lt;/title&gt; &lt;script type="text/javascript" src="http://platform.linkedin.com/in.js"&gt; api_key: some secret api key authorize: true &lt;/script&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;link media="all" type="text/css" href="http://developer.linkedinlabs.com/tutorials/css/jqueryui.css" rel="stylesheet"/&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.5b1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js" &gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function loadData() { IN.API.Profile("me") .fields(["id", "firstName", "lastName", "pictureUrl","headline"]) .result(function(result) { profile = result.values[0]; /* profHTML = "&lt;p&gt;&lt;a href=\"" + profile.publicProfileUrl + "\"&gt;"; profHTML += "&lt;img class=img_border align=\"left\" src=\"" + profile.pictureUrl + "\"&gt;&lt;/a&gt;"; profHTML += "&lt;a href=\"" + profile.publicProfileUrl + "\"&gt;"; profHTML += "&lt;h2 class=myname&gt;" + profile.firstName + " " + profile.lastName + "&lt;/a&gt; &lt;/h2&gt;"; profHTML += "&lt;span class=myheadline&gt;" + profile.headline + "&lt;/span&gt;"; */ profHTML = profile.id; //alert(profHTML); alerts the id //$("#profile").html(profHTML); }); } &lt;/script&gt; &lt;/head&gt; &lt;body class="yui3-skin-sam yui-skin-sam"&gt; &lt;script&gt;alert(profHTML);&lt;/script&gt; &lt;!-- Does not alert anything--&gt; &lt;div id="profile"&gt; &lt;/div&gt; &lt;script type="IN/Login" data-onAuth="loadData"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I am trying to capture the profile id in the HTML file , but unable to do that . How can I display it in the HTML file ? And why my code is not working . Please help </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