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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:54:39+00:00 2026-05-17T17:54:39+00:00

i have an unusual javascript problem, i have a javascript problem that alternately refuses

  • 0

i have an unusual javascript problem, i have a javascript problem that alternately refuses to work. Basically, on the first click, the jquery function works as it should, deleting the table row, and redrawing the table rows:

$(".deleteRow").click(function(e){
                if(confirm("This will delete the selected week. Are you sure?")){
                    $.ajax({
                        type: 'POST',
                        url: 'http://localhost/todo/index.php/home/ajax_delete',
                        data: { page_id : $(this).attr('id') },
                        success: tableRedraw,
                        dataType: 'html'
                    })
                };
                e.preventDefault();
              })

however, if i click the button that triggers this again, it doesnt work. Instead of going through the javascript function, it follows the link (designed for non javascript mode). I cant understand this unusual behaviour, i might have thought that it was caused by the jquery source not being available (for some unknown reason) but i have another function that adds rows to the table, that can be used many times in succession with no problems:

$("#addRow").click(function(e){
                $.ajax({
                        type: 'POST',
                        url: 'http://localhost/todo/index.php/home/ajax_add',
                        success: tableRedraw,
                        dataType: 'html'
                    })
                e.preventDefault();
              })
            })

any help would be hugely appreciated.

  • 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-17T17:54:39+00:00Added an answer on May 17, 2026 at 5:54 pm

    I’m guessing it has to do with your tableRedraw method. If it actually destroys the table, and redraws the entire thing, you’re also destroying any reference to jQuery managed event handlers.

    I’d guess the reason #addRow keeps working is that it’s not actually part of the table that is getting redrawn, or is somehow otherwise being spared from being destroyed.

    I don’t know what your code requirements are, but it would seem wasteful to destroy and redraw an entire table just to add/remove a row (if that is indeed what is happening). Instead it would seem better to target only the individual row that needs manipulation.

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

Sidebar

Related Questions

I have an unusual problem. I have a function, operation in this function can
Hey guys, unusual question: I have a input field #birthday that should accept european
I have a custom developed WordPress plugin that is using jQuery 1.4 and for
I have an unusual problem (this is linked to Browser displays � instead of
Hello I have an unusual date format that I would like to parse into
Salute.. I have an unusual problem. Here in this table in MSDN library we
I have a URL in an iPhone application to work with. But the problem
I have an unusual situation to model in a MS SQL Server database: the
I have a bit of an unusual question. I'm running an old DOS game
Have you managed to get Aptana Studio debugging to work? I tried following this,

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.