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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:31:06+00:00 2026-05-24T06:31:06+00:00

I have this Jquery line which finds the cell I would like to input

  • 0

I have this Jquery line which finds the cell I would like to input data into, This works when I use it outside of my $.post function (below), but not inside my $.post

$(this).parent().parent().find(".total_item_price").html("new text");

But when I use the above line in the below example, It does not work. It doesn’t update the text in the required field.

$.post(url, { "params": value}, function(data) {

          // This is where I am having a problem
          // also tried .text and .val
          $(this).parent().parent().find(".total_item_price").html(data.total_price_item);

          alert(data.total_price_item); // This outputs my data
       }, "JSON"); 

I basically want to put my returned (data) into the cell of the table. I don’t think that my table structure is the issue, but I can post it if needed.

I should add, that I have to find the parents and field, because each post function will output into a different cell, so its relative to where the user clicked.

Whats going wrong in this code?

  • 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-24T06:31:08+00:00Added an answer on May 24, 2026 at 6:31 am

    Because this inside your load callback is not equal to this outside of your load callback. They have different scopes.

    Before you call the post, cache the this from the other scope into a variable:

    var scope = this;
    

    And then in your callback you can reference the other this as scope:

    $(scope).parent().parent().find(".total_item_price").html(data.total_price_item);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this jquery script which suppose to hide/show div element base on the
On my main page I have this jquery code which does an ajax call
I have a set of div elements. In jQuery , I would like to
I have this line which successfully select all elements of classmyclass on my page:
I have code like this: _removeSelection : function(e, refocus) { var thisObj = e.data,
I've built this website relying heavily on JQuery, and have run into an issue
I would really like use the jQuery Validation plugin in my ASP.NET Web Forms
I have this line of jQuery: $(#colorimage).css('background','url(images/bw.jpg)'); First question: the way that this is
I have this jQuery: $(document).ready(function() { $(#panel).hide(); $('.login').toggle( function() { $('#panel').animate({ height: 150, padding:20px
I have this jQuery datepicker code that initially set the minDate of the datepicker.

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.