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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:32:14+00:00 2026-05-21T23:32:14+00:00

Ok, So I have over 1000 lines of jQuery code, and other functions are

  • 0

Ok, So I have over 1000 lines of jQuery code, and other functions are also using appendTo and it works.

However it seems that the following function appendTo wont work, while append does work.

I think it is because I am creating the DIV in the jquery file and the asking another function to fill that div. but am not sure if that is the reason.

here is the function that is playing up.

function getmessage(e) {
    $('#loadmessage').html("");
    $.getJSON('sys/classes/usermessage.php?task=fetch&subkey=' + e + '&userid=' + sessionparts[1], function(getmessage) {
        // get line status
        $.each(getmessage, function(i, item) {

            $('#loadmessage').append(item.subkey);
        });
    });    
};
  • 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-21T23:32:14+00:00Added an answer on May 21, 2026 at 11:32 pm

    The reason is that .appendTo() will not work in this case because your item.subkey is not a dom element. You have 2 choices.

    1) Use .append() as your code is now

    2) For using .appendTo() put your item.subkey in a dom node, as the following:

    $.each(getmessage, function(i, item) {
        $("<span />").text(item.subkey).appendTo('#loadmessage');
    });
    

    Hope this helps. Cheers

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

Sidebar

Related Questions

I wrote a page by javascript that has over 1000 lines of code and
I have a chunk of code that I'm using to get the UNC path
In my code, I have an array that has about 1000 elements : Object[]
We have over 1000 unit tests. A while ago 18 of them started to
I have a set of data with over 1000 entries. I can filter these
I have over a million text files compressed into 40 zip files. I also
I have a program that can have a lot of parameters (we have over
We all know the effects that lots of thrown exceptions can have over the
If I'm building an application that will have over 30 models, and I want
im planning to create a movie file that might have over 16,000 frames?i know

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.