Treehouse: Grow your CSS skills. Land your dream job.

jQuery – Oups, something’s wrong

  • # December 16, 2009 at 6:04 am

    Hi everyone,

    Here is my problem

    In my new app, you have empty div where you can add an app. When I click on Add an App, a popup fade in and let you choose. The user choose his app, and the link to the app is then clone into the div. Until there, everything is okay. But when you erase the content of the div, if you re-click on Add an App, it duplicates the link added into the div (is it clear?).
    I know something is wrong in the second part of the code, when the user select his app. Because the eraser works perfectly. Could you please help me?

    Here is the code


    var linkClicked = $(this);

    $(‘#app-store a’).click(function()
    var userChoice = $(this);
    var titleUserChoice = $(userChoice).attr(“title”);
    var hrefUserChoice = $(userChoice).attr(“href”);
    var appDivSelected = $(linkClicked).parent();
    $(userChoice).attr(“href”, titleUserChoice).attr(“title”, “”).clone().prependTo(appDivSelected);
    return false;

    # December 16, 2009 at 10:14 am

    Do you have a live site somewhere that we could look at?

    # December 16, 2009 at 10:38 am

    Yes, but only by DM, I’m sorry, because it’s the next product we’re working on. I send you one right now. Sorry for the inconvenience.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.