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 6783343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:51:08+00:00 2026-05-26T16:51:08+00:00

im having some wierd problems with selecting an element with a class. in my

  • 0

im having some wierd problems with selecting an element with a class.
in my case i have this AJAX query, that returns some links with the same class.
when i click the link an event should happend, but it didn’t.

then i tried with makeing it alert when the an element with the class had been clicked, nothing happends, then i try to make a direct link on the page with the same class, now it gives me the alert..

what is happening ? the ajax query checks if the user is online, and does this every 1 minute, the element has the class “friend” and i try to call it by this code:

$('.friend').click(function(){
    alert('clicked');
});

nothing happends with the ones displayed by the ajax request. but it responds to the links put directly onto the site.

  • 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-26T16:51:09+00:00Added an answer on May 26, 2026 at 4:51 pm

    Try using live:

    $('.friend').live('live',function(){
        alert('clicked');
    });
    

    It will append that handler to items that exist and items that will exist with that selector.

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

Sidebar

Related Questions

Um, this might sound a bit weird. We were having some problems with a
I just began having problems with Indy. For some weird reason, even this very
I'm having some weird problems with this. We are using Xvfb virtual desktop manager
I'm new to Ruby, so I'm having some trouble understanding this weird exception problem
I'm having the weird problem that after having javascript inject some dom-elements the css-rules
I'm having some wierd behaviour in my WinForm application coded in c#. in my:
I'm having some weird issues with Xcode, and this is pretty much impossible to
I'm having some weird trouble with a project on VS2005. I have a few
I'm having some problems debugging my code as I can't work out where an
I have an FLA done in Flash 10, and some AS3 code that manipulates

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.