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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:21:07+00:00 2026-06-01T09:21:07+00:00

hello i am new here and i hope i don`t post in a wrong

  • 0

hello i am new here and i hope i don`t post in a wrong place
the problem is like this:
i use a .getJson to retrive results from a database.
and the results are appendet to a table [multiple rows] once i click to a img it loads a detailed view of the data into a div(or another table).
my problem is the following:
i must remove the old content of the detailed div – only the appendTo part –

the code looks somethink like this:

script:

$("button.#results").click(
function(){
$.getJSON(dataretrive.php?callback=?&query=1' ,
function(data) {
$.each(data, function(i, item) {
var mindata = "<tr><td class='border'>" +data[i].name+ "</td>";
.... [minimal data]

$(mindata).appendTo("table.#shorttableinfo");

var detailfull = "<tr valign='top' height='25' width='100px'><td> Name: </td><td>" + data[i].name + "</td></tr>"
... [lots of data]

$("img.#editrow" + i ).click(   
function(){
    $(detailfull).appendTo("table.#detailsfull");
});
});
});
});

the html:

[html code]

&lt;table id="shorttableinfo"&gt; // i need a small table here

&lt;tr&gt;&lt;td&gt;Name:&lt;/td&gt;&lt;td&gt; [other minimal data] &lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;

[other html code]

&lt;table id="detailsfull"&gt; // i need a small table here

&lt;tr&gt;&lt;td&gt;Name:&lt;/td&gt;&lt;td&gt; [other minimal data] &lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;

my problem is that i need the code to be removed before jquery loads the new data into the tablbe with id detailsfull, without removing the first row of the table.

  • 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-06-01T09:21:09+00:00Added an answer on June 1, 2026 at 9:21 am

    Your selector is invalid on appendTo(), should be appendTo("table#shorttableinfo")

    You can remove your rows via

    $('table#detailsFull tr:gt(0)').remove();
    

    The above will remove all rows but the first one out of your detailsFull table

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

Sidebar

Related Questions

I am new here so hello. I am using ASP.NET 4 and I am
Hello I am new at Haskell and i'm having problems trying to get this
hello I am new here and in programming as well. Today I have been
I've reached my skills limit here. I don't even know if this is possible
class Hello @hello = hello def display puts @hello end end h = Hello.new
hello im new to python and have been reading over the documentation and am
Hello.Am new to ios development.What have to do for NSOpenPanel to work in the
hello I'm new to PHP programming and I migrated from ASP .net to PHP..
Hello I'm new to ontologies, my assignment is to create an ontology using Protege
Hello I am new to assembly and I'm struggling to get a two-part program

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.