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

  • SEARCH
  • Home
  • 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 7638349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:09:18+00:00 2026-05-31T08:09:18+00:00

I am creating a facebook app an am struggling on some jquery. In its

  • 0

I am creating a facebook app an am struggling on some jquery. In its simplest terms I have a left hand column with the pictures and names of all the facebook friends in a list. When I click on them the face moves to a right hand column and I hide the face with css display:none on the left hand column. So the jquery is dynamically adding an list to the right hand column.

Also when I click on a face on the left hand column, before it moves over to the right hand column a pop up appears saying you have selected that person.

So far all working good (bear with me). When I have a face on the right hand column I have an option to remove them from the right hand column. When I click on this it removes a face and a pop up appears saying you have removed that person. Everything works apart from the fact that the pop up cannot find the persons name in the list and it just says undefined. This is the code that adds the person to the right hand column (this works perfect)

$(".list").live("click", function () {
    var id = $(this).attr("id");
    var PersonName = $(this).children('.listcontent').children('.pname').html();
    var hiddenid = $("#HiddenField1").val() + '|' + id;
    $("#HiddenField1").val(hiddenid);

    var hiddenperson = $("HiddenField3").val() + '|' + PersonName;
    $("#HiddenField3").val(hiddenperson);

    var url = "http://graph.facebook.com/" + id + "/picture?type=large";
    $("#personimage").attr('src', url);

    var src = "http://graph.facebook.com/" + id + "/picture?type=square";
    var lightboxmessage = "<h2>You have selected " + PersonName + "</h2>";
    $("#lightboxcontentright").html(lightboxmessage);

    $("#lightbox, #lightbox-panel").fadeIn(300)

    var personexists = findimage(id);
    if (personexists == "false") {
        var newperson = "<li class='list1' id='" + id + "A'><div class='listcontent'><img src=" + src + "><label css='pname'>" + PersonName + "</label></div><div class='selectme'><Label>Delete</Label></div></li>";
        $("#selectedlist").append(newperson);
        $(this).css("display", "none");

    }
});

This is the code to remove the face from the right hand column

$(".list1").live("click", function () {
    var id1 = $(this).attr("id");
    var id = id1.substring(0, id1.length - 1);

    <! -- THIS IS THE BIT THAT DOES NOT WORK
    var PersonName = $(this).children(".listcontent").children(".pname").html();
    alert(PersonName);
    <!-- END -->

    var hiddenid = $("#HiddenField1").val();
    hiddenid = hiddenid.replace('|' + id, '');
    $("#HiddenField1").val(hiddenid);

    var hiddenperson = $("#HiddenField3").val();
    hiddenperson = hiddenperson.replace('|' + PersonName, '');
    $("#HiddenField3").val(hiddenperson);

    var url = "http://graph.facebook.com/" + id + "/picture?type=large";
    $("#personimage").attr('src', url);

    var lightboxmessage = "<h2>You have de-selected " + PersonName + "</h2>";
    $("#lightboxcontentright").html(lightboxmessage);
    $("#lightbox, #lightbox-panel").fadeIn(300);

    $(this).css("display", "none");

    $("#" + id + "").css("display", "inherit");
});

I thought it might have something to do with the .live function or dynamically creating lists. As you can see there is not much difference in the code

thanks in advance

  • 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-31T08:09:20+00:00Added an answer on May 31, 2026 at 8:09 am

    In this line in the first code block you have misspelled ‘class’ as ‘css’ in the label. The label would never have the class property set.

    var newperson = "<li class='list1' id='" + id + "A'><div class='listcontent'><img src=" + src + "><label css='pname'>" + PersonName + "</label></div><div class='selectme'><Label>Delete</Label></div></li>";
    

    Change it to:

    var newperson = "<li class='list1' id='" + id + "A'><div class='listcontent'><img src=" + src + "><label class='pname'>" + PersonName + "</label></div><div class='selectme'><Label>Delete</Label></div></li>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While creating a mobile web app with the Facebook javascript SDK, I have one
Here I am creating an iPhone app using facebook api. I have loaded the
I've been reading about creating my first facebook app. Some sites say I need
I'm creating a Facebook app in which I want to display content depending on
I am creating a Java web app that is meant for use by Facebook
I have an app called static HTML (https://apps.facebook.com/static_html_plus/?ref=ts) installed on a page of mine..
I'm creating a new app and I want to use some libraries like this:
I'm creating a responsive design but have run into a problem where the Facebook
I am busy creating my very first Facebook application, and although I have PHP
I'll be creating a Facebook app and I wish to restrict it to a

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.