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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:30:23+00:00 2026-05-25T16:30:23+00:00

I want to get data through Ajax and fill them into div .content, but

  • 0

I want to get data through Ajax and fill them into div .content, but it won’t work.

HTML:

<div class="review">
  <span class="seefull" rel="1">see full content</span>
  <div class="content"></div>
  <div class="c_createtime">(06-15 04:03:13)</div>
</div>

<div class="seg_r"><img src="http://img.dachaocai.com/sys/seg_2.gif"/></div>

<div class="review">
  <span class="seefull" rel="2">see full content</span>
  <div class="content">12</div>
  <div class="c_createtime">(07-31 12:46:18)</div>
</div>

jQuery:

$(function() {
  $(".seefull").click(function() {
    $.ajax({
      url: "/j/fullreview",
      data: {"t":"b","id":$(this).attr("rel")},
      success: function(data) {
        $(this).find("div .content").html(data);
      }
    })
  })
})
  • 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-25T16:30:24+00:00Added an answer on May 25, 2026 at 4:30 pm
      $(function(){
            $(".seefull").click( function (){
                var $this = $(this);
                $.ajax({
                    url:"/j/fullreview",
                    data:{"t":"b","id":$this.attr("rel")},
                    success:function(data){
                        $this.parent().find(".content").html(data);
                    }
                });
            });
      });
    

    It’s about the context of “this”.

    When the ajax callback function executes, this does not refer to your original object anymore. So, you need to store its original reference on a variable, and use to that variable from there on to be sure you are always referring to the right element.

    var $this = $(this);
    

    With the above code, your object is now stored in the $this variable.

    $this.parent().find(".content").html(data);
    

    Find the parent of our element, then find the element with class “content”, and change its content.

    I didn’t find a div of class content because from your code there is only one element with that class.

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

Sidebar

Related Questions

I have data that I want to send through an ajax GET request in
I want to get data using CURL but I have a problem. When I
I want to get data from two tables with single Entity class. How?? public
I have a javascript object (I actually get the data through an ajax request):
I am trying to get some data through ajax and I for whatever reason,
I use Wordpress, PHP, jQuery and AJAX. I can get data from PHP through
This is my jsp that get called through ajax. <s:iterator var=result value=all id=result> <div
I want to get individual posts from a blogger blog, and make them into
jQuery.get(ajax.php, function(data) { $(data).find(div[id^='feed']).each(function() //Find every div with id starting with feed in AJAX
I want to request something with AJAX (no problem), I'll get plain html back

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.