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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:56:37+00:00 2026-06-18T00:56:37+00:00

Well, I inserted an anchor tag with jquery: $.post(url, {key:key}, function(data) { $(‘#links’).html(data); });

  • 0

Well, I inserted an anchor tag with jquery:

 $.post(url, {key:key}, function(data) { 
    $('#links').html(data); 
    }); 

data returned from a php file is:

<a href="#" class="some-class">Hypertext<a>

When this link is clicked i want to return false so i did:

 <a href="#" class="some-class" onclick="someFunction(); return false">Hypertext</a>

but it isn’t returning false, but the function is called. I tried to return false from the function it isn’t working either.

And when I tried to use:

$('.some-class').click(function() {
   // something
   }); 

this didn’t call the function. I couldn’t find a way to fix this, any 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-06-18T00:56:40+00:00Added an answer on June 18, 2026 at 12:56 am

    You need to use on() with a delegated event handler as the .some-class element is being dynamically appended. You’ll also want to use event.preventDefault() to stop the standard link behaviour. Try this:

    $('#links').on('click', '.some-class', function(e) {
        e.preventDefault(); // stop link behaviour
        // do something...
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having this code to post data to server by android application. So ,
If I have a map/multimap with keys inserted using a comparison function (functor), is
So i have a database where there is a lot of data being inserted
I have a problem storing my inserted data to my database. When I'm using
I have the following xml document: <?xml version=1.0 encoding=UTF-8?> <root> <data> <child1>&#160;Well, some spaces
well. about my Windows phone Application . how to determine the headphones is inserted
I finally have jQuery AJAX down pretty well and have my website all created,
I just inserted into a vector and all is well, when I went to
Well.. I want to check if the a url is valid. So that they
I want to perform some business validation of the data being inserted in 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.