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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:02:40+00:00 2026-05-29T06:02:40+00:00

I am working with JQuery and making a ajax call to delete some stuff

  • 0

I am working with JQuery and making a ajax call to delete some stuff form database based on ID like this:

$(".delete").live('click', function(event) {
                  var item = $(this),
                      commentContainer = item.parent(),
                      id = item.attr("id"),
                      string = 'solutionID=' + id;
                      item.next('.loading2').fadeIn();

                  $.ajax({
                    type: "POST",
                    url: "/js/ajax/delete-comment.php",
                    data: string,
                    cache: false,
                    success: function(){
                      commentContainer.slideUp('slow', function() {
                        item.remove();
                        $('.loading2').fadeOut();
                      });
                    }
                  });
                  event.preventDefault();
                });

The page itself has this:-

<a href="#" id="55" class="delete">DELETE</a><div class="loading2"></div>

It works the first time and I am using “live()” to make sure that it works after the ajax call too.
Nevertheless after the ajax call it seems to work but the ID of the element is not posted, although is there.

Anyone has an idea about this problem? Please

THANK YOU AVERYBODY. I FOUND THE PROBLEM:

It wasn’t Jquery or html related but a missed call in SQL query for solution.solutionID.
My apologies.

  • 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-29T06:02:42+00:00Added an answer on May 29, 2026 at 6:02 am
    $(".delete").on('click', function(e) {
        var item = $(this);
        var commentContainer = item.parent();
        str = 'solutionID=' + this.id;
        item.next('.loading2').fadeIn();
    
        $.ajax({
            type: "POST",
            url: "/js/ajax/delete-comment.php",
            data: str,
            cache: false,
            success: function(){
                commentContainer.slideUp('slow', function() {
                    item.remove();
                    $('.loading2').fadeOut();
                });
            }
        });
    
        e.preventDefault();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this function in charge of making a ajax call, and based on
I am trying to get an autocomplete working and making an Ajax form submission
I am making an ajax call in jquery $.get(validate_isbn.php, {isbn: obj[16]}, function(answer) { console.log(answer);
I am making this simple get request using jquery ajax: $.ajax({ url: https://app.asana.com/-/api/0.1/workspaces/, type:
I'm making a standard JQuery .ajax call, already jumped through hoops to get it
I had a perfectly well working jquery ajax function but I'm making it better.
I'm working on my portfolio, making it entirely jQuery based. So my problem is
I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC
I'm working with jQuery for the first time and need some help. I have
I'm currently working with jQuery 1.4.2 and jQuery UI 1.8.2. I'm experiencing some weird

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.