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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:08:19+00:00 2026-05-17T00:08:19+00:00

I’m trying to write up a function which will post data (and append the

  • 0

I’m trying to write up a function which will post data (and append the results inside a div) when you click on the div. I’ve got it so it will alert the data, but for some reason I can’t get it to append the data back inside the clicked div?

The clickable div:

<div class="qaContainer">
  <h2>testing title</h2>
  <input type="hidden" name="catid" id="catid[]" class="catid" value="3">
</div>

And the jquery:

jQuery(".qaContainer").click(function () {
  var cat_id = jQuery(this).find(".catid").val();
  if (cat_id) {
    jQuery.post("/index.php?option=com_qa&view=questions&catid=2&Itemid=33", { catid: cat_id }, function(data) {
    jQuery(this).append(data);
  });
};

The data which it’s returning:

<div class="info">
  <div class="question">testing 1</div>
  <div class="answer">testing 2</div>
</div>

Now I want the returned data to sit back inside the qaContainer div, after the hidden input, which is why I’m trying to use append, but it’s not working. I’m getting this error in FF:

Error: b.createDocumentFragment is not a function
Source File: jquery-1.4.2.min.js
Line: 20

If anyone could help that would be great 🙂

  • 1 1 Answer
  • 2 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-17T00:08:20+00:00Added an answer on May 17, 2026 at 12:08 am

    You can keep a reference to the <div> you clicked, like this:

    jQuery(".qaContainer").click(function () {
      var div = jQuery(this),
          cat_id = div.find(".catid").val();
      if (cat_id) {
        jQuery.post("/index.php?option=com_qa&view=questions&catid=2&Itemid=33", { catid: cat_id }, function(data) {
          div.append(data);
        });
      }
    });
    

    As a side note, did you mean to pass the catid in the querystring (as a constant) and in the POST data?

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I
I'm trying to create an if statement in PHP that prevents a single post
I'm trying to select an H1 element which is the second-child in its group
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace

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.