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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:26:02+00:00 2026-05-26T04:26:02+00:00

I have a jQuery code: $(‘.team-leader-id’).delegate(‘button’, ‘click’, function() { var parent_object = $(this); var

  • 0

I have a jQuery code:

$('.team-leader-id').delegate('button', 'click', function() {
    var parent_object = $(this);
    var admin_id = $(this).parents('.team_data').find('.leader-id').val();
    var team_id = $(this).parents('.team_data').find('.team-hidden-id').val();
    $(this).parents('.team_data').find('.team-leader-mod-button').attr('disabled', 'disabled');
    $(this).parents('.team_data').find('.team-leader-modify').html('Mégse');
    $(this).parents('.team_data').find('.ajax-json-response').fadeOut(1).html('');
    $(this).parents('.team_data').find('.ajax-json-loading').html('<img src="images/progress-dots.gif" />').fadeIn('slow');

    $.ajax({
        type: 'POST',
        url: 'json.php',
        dataType: 'json',
        cache: false,
        timeout: 20000,
        data: { a: 'change_team_admin', admin_id: admin_id, team_id: team_id },
        success: function(data) {
            $(parent_object).parents('.team_data').find('.ajax-json-loading').fadeOut(1).html('');
            $(parent_object).parents('.team_data').find('.ajax-json-response').html(data.message).fadeIn(400).delay(2000).slideUp(400);
            if (!data.error) {
                $(parent_object).parents('.team_data').find('.team-leader-id').html('<a href="http://lanseries.hu/index.php?oldal=profile&p_id='+admin_id+'" target="_blank">'+admin_id+'</a>');
                PROBLEM -->$(parent_object).parents('.team_data').find('.team-leader-modify').text('OKÉ');<--
            } else {
                $(parent_object).parents('.team_data').find('.team-leader-mod-button').removeAttr('disabled');
                $(parent_object).parents('.team_data').find('.team-leader-modify').html('<a href="javascript:void(0)">Mégse</a>');
            }
        },
        error: function(jqXHR, textStatus, errorThrown) {
            $(parent_object).parents('.team_data').find('.ajax-json-loading').fadeOut(1).html('');
            //$(parent_object).parents('.team_data').find('#ajax-json-response').html('Probléma történt! Kérlek próbáld újra később! (HTTP Error: '+errorThrown+' | Error Message: '+textStatus+')').fadeIn('slow');
            $(parent_object).parents('.team_data').find('#ajax-json-response').html('Probléma történt! Kérlek próbáld újra később, és ellenőrizd az internetkapcsolatod!').fadeIn('slow');
        }
    });
});

Everything is working well, it’s ok, but one row not run! You can find it in the code.

PROBLEM -->$(parent_object).parents('.team_data').find('.team-leader-modify').text('OKÉ');<--

HTML: (There are some thousands of this code part, so I can’t use ids everywhere.

<div class="dnone team_data" id="team_<?php echo $allnum; ?>" style="padding: 10px; margin: 2px 0 2px 0; border: 1px solid <?php echo $site_color; ?>;">
<div class="ajax-json-loading"></div>
<div class="ajax-json-response"></div>
<table cellspacing="5">
    <tr>
        <td valign="top" style="width: 100px;">
            <b>Csapat vezető:</b>
        </td>
        <td class="team-leader-area">
            <input type="hidden" class="team-leader-hidden-id" value="<?php echo $value['leader']; ?>" />
            <input type="hidden" class="team-hidden-id" value="<?php echo $value['id']; ?>" />
            <div class="team-leader-id"><a href="http://lanseries.hu/index.php?oldal=profile&p_id=<?php echo $value['leader']; ?>" target="_blank"><?php echo $value['leader']; ?></a></div>
            <div class="team-leader-modify"><a href="javascript:void(0)">Módosít</a></div>
        </td>
    </tr>
    <tr>
        <td valign="top" style="width: 100px;">
            <b>Befizető címe:</b>
        </td>
        <td>
            <?php echo $value['p_address']; ?>
        </td>
    </tr>
</table>

Could you tell me why?

Thanks in advance!

  • 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-26T04:26:03+00:00Added an answer on May 26, 2026 at 4:26 am

    Break it down. I would put the following above the problem line and check the console in Chrome the entries exist:

    console.dir($(parent_object).parents('.team_data'));
    console.dir($(parent_object).parents('.team_data').find('.team-leader-modify'));
    $(parent_object).parents('.team_data').find('.team-leader-modify').text('OKÉ');
    console.dir($(parent_object).parents('.team_data').find('.team-leader-modify').text());
    

    Also, I wouldn’t make so many calls to $(parent_object).parents('.team_data'). It’s a somewhat costly operation.

    Instead, at the beginning of the response functions do something like:

    var $teamData = $(parent_object).parents('.team_data');
    

    Then reference $teamData for your remaining jQuery calls.

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

Sidebar

Related Questions

I have this JQuery code: $(div.notification).live(click, function(){ window.location=$(this).find(a).attr(href); var myId = $(this).attr(id); $.post(/videos/selected_notification.js, myId);
I have this jquery code : $(document).ready(function() { $('div.badge_button > .more').click(function() { var id
I have following jQuery code $('a.editpo, a.resetpass').click(function(event){ event.preventDefault(); var urlToCall = $(this).attr('href'); var hyperlinkid
I have this jquery code: $(.button-banc).hover(function() { $(.button-banc img) .animate({ top: -21px }, 200).animate({
I have this jQuery code: $(.right_box_holder).sortable({ update : function () { var order =
I have some jQuery code something like this: $(document).ready(function() { $(img.off).click(function() { alert('on'); $(this).attr('class',
I have this jQuery code: $(.topic_form).hide(); $(#edit_topics_link).click(function(e) { e.preventDefault(); $(.topic_form).show(); $(this).hide(); $(<a href='#' id='done_link'>Done</a>).insertBefore(.topic_form);
I have jQuery code which looks something like this on Button1 Click $('table.result_grid tbody
I have this jQuery code; $(function () { $(window).unbind(beforeunload); $(window).bind(beforeunload, function () { return
I have this jQuery code, which uses the toggle() function on a checkbox input

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.