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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:51:12+00:00 2026-05-31T18:51:12+00:00

although I searched through existing threads for my problem I havent found a solution

  • 0

although I searched through existing threads for my problem I havent found a solution yet. I have a page which displays reports. The HTML of it looks like this:

<div class="reports-body" report-id="4">
    <!--Some HTML-->
    <div class="comments-title">
        <h3>3 Comments</h3>
    </div>
    <div class="comments">
        <!--The Comments-->
    </div>
</div>
<div class="reports-body" report-id="5">
    <!--Some HTML-->
    <div class="comments-title">
        <h3>3 Comments</h3>
    </div>
    <div class="comments">
        <!--The Comments-->
    </div>
</div>
<div class="reports-body" report-id="6">
    <!--Some HTML-->
    <div class="comments-title">
        <h3>3 Comments</h3>
    </div>
    <div class="comments">
        <!--The Comments-->
    </div>
</div>
etc...

Every reports-body has a commentbox, where a user can write a comment to this specific report. Now I want to reload the reports-body everytime after a user has submitted a comment. The reason why I wanted to reload the whole reports-body is, that the number in the comments-title needs also be refreshed, since the number is increased.

Unfortunatley my code doesn’t really work ~.~ My skills are not good enough to see the problem thats why I asked you for help. Here is the jquery code:

// defined earlier
var parent = $(this).closest('form')
// ...

$.ajax({
    type: 'post',
    dataType: 'json',
    url: webroot + 'reports_comments/add',
    data: data,
    beforeSend: function(XMLHttpRequest) {
        ajaxloader.show();
    },
    success: function(data) {
        if(data.status == 'success') {
            var server = data.server;
            var id = data.id;
            var summoner = data.summoner;
            var url = webroot + '/summoner/' + server + '/' + id + '-' + summoner;
            var rb = parent.parents('.reports-body');

            rb.load(url + ' .reports-body[report-id=' + rb.attr("report-id"));
        } else {
            parent.find('#ReportsCommentContent').css("border", "2px solid #BB1A11");
        }
    },
    error: function(request) {
        alert("Request Error.");
    },
    complete: function() {
        ajaxloader.hide();
    }
});

After submitting the comment, the reports-body disappears instead of getting reloaded. I hope you can help me.

  • 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-31T18:51:13+00:00Added an answer on May 31, 2026 at 6:51 pm

    You’ve forgot a bracket int the called URL.

    rb.load(url + ' .reports-body[report-id=' + rb.attr("report-id"));
    
    rb.load(url + ' .reports-body[report-id=' + rb.attr("report-id")+']');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched many threads so far but cant seem to find a solution.
I have a difficult problem. Difficult means I searched through the net and StackOverflow
I have an exceptionally bad CSV file. Although I solved the problem in the
I searched the web and I searched stackoverflow up and down. No solution. Although
Although I have searched for many information about Cocoa Bindings, I still remain relatively
I have searched a lot of threads but i can't find any answer that
Although I've searched the Board and used google, I didn't get any useful results.
I looked and searched and couldn't find what I needed although I think it
Although somewhat related to this question , I have what I think is a
Although I don't have an iPhone to test this out, my colleague told me

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.