Note that there are some explanatory texts on larger screens.

plurals
  1. POhow can i remove appendet text from a div?
    primarykey
    data
    text
    <p>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 -</p> <p>the code looks somethink like this:</p> <p>script:</p> <pre><code>$("button.#results").click( function(){ $.getJSON(dataretrive.php?callback=?&amp;query=1' , function(data) { $.each(data, function(i, item) { var mindata = "&lt;tr&gt;&lt;td class='border'&gt;" +data[i].name+ "&lt;/td&gt;"; .... [minimal data] $(mindata).appendTo("table.#shorttableinfo"); var detailfull = "&lt;tr valign='top' height='25' width='100px'&gt;&lt;td&gt; Name: &lt;/td&gt;&lt;td&gt;" + data[i].name + "&lt;/td&gt;&lt;/tr&gt;" ... [lots of data] $("img.#editrow" + i ).click( function(){ $(detailfull).appendTo("table.#detailsfull"); }); }); }); }); </code></pre> <p>the html: </p> <p>[html code]</p> <pre><code>&amp;lt;table id="shorttableinfo"&amp;gt; // i need a small table here &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Name:&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; [other minimal data] &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; &amp;lt;/table&amp;gt; </code></pre> <p>[other html code]</p> <pre><code>&amp;lt;table id="detailsfull"&amp;gt; // i need a small table here &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Name:&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt; [other minimal data] &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; &amp;lt;/table&amp;gt; </code></pre> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload