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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:04:12+00:00 2026-05-16T11:04:12+00:00

This is the function function deleteItem(id) { $.post(_asyncpage.php, {id:id}, function (result) { if (result

  • 0

This is the function

function deleteItem(id) {
    $.post("_asyncpage.php",
        {id:id},
        function (result) {
            if (result == true) {
                $('#'+id).remove();
            }
        }, "json"); 
}

So, to explain, the function receive an id, send to a page that execute random stuff on a db and return true/false.

The function inside check for result that can be true/false as said before.
If true proceed to remove the dom element that match the id passed.

The db is updated correctly but the .remove() won’t work… someone knows why? 🙁

The following is an example of the html structure. the table inside the TD is the one to be deleted.

<td width="120" valign="top" id="13_02">
   <table cellspacing="0" cellpadding="0" class="tableProg" id="1">
   <tbody>
      <tr>
         <td colspan="3"><h4 style="margin: 0pt;">Title</h4></td>
      </tr>
      <tr>
         <td colspan="3">h. 13:35</td></tr><tr><td width="74"><span style="font-weight: bold; color: rgb(0, 102, 204);">Su</span>: TV</td>
         <td width="22"><a href="javascript:openEditItem('2010/08/24','1')"><img src="static/images/edit.gif"></a></td>
         <td width="22"><a href="javascript:deleteItem('1')"><img src="static/images/delete.gif"></a></td>
      </tr>
   </tbody>
   </table>
</td>
  • 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-16T11:04:12+00:00Added an answer on May 16, 2026 at 11:04 am

    Update: From the additional info you provided, the issue may be with your IDs. It is not valid for an ID to start with a number. This can cause problems.


    If your id that you’re passing to the function already has a # at the beginning, then you don’t want to concatenate it.

    Also, if the response you’re getting is a string, then you would want to compare the result to the string 'true'.

    if (result == 'true') {...
    

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

Sidebar

Related Questions

For example, I have a php function: function DeleteItem($item_id) { db_query(DELETE FROM {items} WHERE
I am having issues getting my remove element function working. I have this function:
I have this page <script type=text/javascript> $(document).ready(function () { $(#delete).click(function () { if (confirm)
This function should write the time spent on the page to the div. It
This function returns ArrayList that contains some data from DB: public ArrayList<ArrayList<Object>> executeQuery(String host,
This function works fine: std::string get_str() { return std::get<0>( make_tuple(std::string(hi)) ); } But if
This function is in a Class file in App_Code folder Public Shared Function CRUD(ByVal
This function works as it should, window.setInterval(function(){ var active = $('#frontpageControls a.active'); var next
This function only works once, when I click an anchor element again, nothign happens.
This function gives error: function RefreshGrid(){ window.location.href=Form_ElameMamoreBazdid.aspx; }

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.