Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6230263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:42:53+00:00 2026-05-24T09:42:53+00:00

Take a look at my code : <html> <head> <title>Profile App Example</title> <script type=text/javascript

  • 0

Take a look at my code :

<html>
<head>
<title>Profile App Example</title>

<script type="text/javascript" src="http://platform.linkedin.com/in.js">
  api_key: some secret api key
  authorize: true
</script>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link media="all" type="text/css" href="http://developer.linkedinlabs.com/tutorials/css/jqueryui.css" rel="stylesheet"/>
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.5b1.js"></script>
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js" ></script>

<script type="text/javascript">

function loadData() {
  IN.API.Profile("me")
    .fields(["id", "firstName", "lastName", "pictureUrl","headline"])
    .result(function(result) {
      profile = result.values[0];
/*
      profHTML = "<p><a href=\"" + profile.publicProfileUrl + "\">";
      profHTML += "<img class=img_border align=\"left\" src=\"" + profile.pictureUrl + "\"></a>";     
      profHTML += "<a href=\"" + profile.publicProfileUrl + "\">";
      profHTML += "<h2 class=myname>" + profile.firstName + " " + profile.lastName + "</a> </h2>";
      profHTML += "<span class=myheadline>" + profile.headline + "</span>";
*/
        profHTML = profile.id;
        //alert(profHTML); alerts the id
      //$("#profile").html(profHTML);
    });
}

</script>

</head>
<body class="yui3-skin-sam  yui-skin-sam">

<script>alert(profHTML);</script> <!-- Does not alert anything-->
<div id="profile">
    </div>  
    <script type="IN/Login" data-onAuth="loadData"></script>
</body>
</html>

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:42:54+00:00Added an answer on May 24, 2026 at 9:42 am

    You need to create element with id='profile' and uncomment $("#profile").html(profHTML); line. $("#profile").html(profHTML) is one of jQuery’s the ways to ‘alert’ to HTML.

    UPDATE: have you tried uncommenting $("#profile").html(profHTML);? If yes, did you get any errors?

    UPDATE 2: if you need to get those var out of the function, you can do the following:

    var my_var = null;
    function loadData() {
        //.....
        profHTML = profile.id;
        my_var = profHTML;
        //.....
    }
    

    If not – I can’t understand what do you want to do with that variable. Please explain further. 🙂

    UPDATE 3: There are two options:

    1. Do an AJAX request to your backend and save cookie. See JQuery.ajax and jQuery.cookie
    2. Write that value to a hidden input in the login form, so this value will be submitted to your backend on form submit.

      jQuery('#hidden').val(profile.id);
      //....somewhere in html....//
      <form> <!--your login form -->
      <input type='hidden' id='hidden' value=''>
      <!-- some other html -->
      </form>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please take a look on this code: <!DOCTYPE html> <html lang=es> <head runat=server> <title>Main
take a look at this example code: public class Comment { private Comment() {
Take a look at the example code... NodeList folderNodes = document.getElementsByTagName(Folder); DocumentFragment node =
Take a look at this example code, which doesn't work: <?xml version='1.0' encoding='UTF-8' ?>
Take a look at this code: public class Test { public static void main(String...
take a look at this code: $(document).ready(function() { document.getElementById(sliderId).onmousedown = sliderMouseDown; }); function sliderMouseDown()
First take a look at my code: <ListBox ItemsSource={Binding} SelectionMode=Multiple ItemTemplate={StaticResource ContactTemplate}> <ListBox.ContextMenu> <ContextMenu>
Please take a look at this code: template<class T> class A { class base
Take a look that the following code snippet: A a = null try {
Take look at the code that follows. Hello World!; The number is , 37;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.