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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:31:38+00:00 2026-06-14T13:31:38+00:00

I have the following code, $(.delete.red).live(click, function () { var self = $(this); var

  • 0

I have the following code,

$(".delete.red").live("click", function () {
    var self = $(this);
    var loadUrl = $(this).attr('href');
    alert("clicked");
    //var interestParents = self.parents('div:eq(4)').attr("id");
    $.ajax({
        type: "POST",
        url: loadUrl,
        dataType: "json"
    }).success(function (msg) {
        alert(msg);
        self.parent().parent().parent().parent().parent().parent().remove();
        $(".selected strong").text(msg.icount)

    });
    return false;
});

What this code does it on click of a link it sends a request off to the clicked links href, it should then find the outermost parent of that link and remove itself from the markup.

Howevever the request is not getting to the done() function I am getting now feedback it is almost as if it is not being called, which seems strange as when I look at the network tab, I can see the links href has been access, and I can see 200 OK response.

Waht is going on?

  • 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-14T13:31:39+00:00Added an answer on June 14, 2026 at 1:31 pm

    Make success part of the options object passed as an argument

    $.ajax({
            type: "POST",
            url: loadUrl,
            dataType: "json",
            success: function (msg) {
                alert(msg);
                self.parent().parent().parent().parent().parent().parent().remove();
                $(".selected strong").text(msg.icount);
            }
    });
    

    The success callback has been deprecated in jQuery 1.8 according to the website

    Deprecation Notice: The jqXHR.success(), jqXHR.error(), and
    jqXHR.complete() callbacks will be deprecated in jQuery 1.8. To
    prepare your code for their eventual removal, use jqXHR.done(),
    jqXHR.fail(), and jqXHR.always() instead.

    According to the site, the live method has also been deprecated

    As of jQuery 1.7, the .live() method is deprecated.
    Use .on() to attach event handlers.

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

Sidebar

Related Questions

I have the following code var dbvalue = Ned; var deleteLink = '<a href=#delete
I have the following function in my jQuery code: function checkUNSelectBox(item){ $('#DELETE option').each(function(){ <!--alert(item);-->
I have the following code $(document).ready(function(){ // class exists if($('.delete').length) { // add click
I have the following code that has @item.ID from razor: <a href=# id=deleteitem(@item.ID)>Delete</a> When
I have the following javascript code: function delete_draft(id, name) { var text = 'Are
On Blackberry 6.0, I have used the following code to delete all the call
I have the following code which is added to a delete button on my
i m making add,edit delete module...For that i have the following code in the
I have the following code: ... sub setImage { my $self=shift; my $filename=shift; unless(-r
I have the following code. When I try to delete the pDest, error occurs.

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.