Try to search your question here, if you can't find : Ask Any Question Now ?

Empty div before append

HomeCategory: stackoverflowEmpty div before append
Avatarwillson asked 4 months ago

I’m trying to append some html code with a loop into an html tag.
But every time that my loop refresh itself the code is appended a second time.
I tried to use $(#nodes).empty(); before the loop but with this method i get a blank screen.

This is the code snippet

   $(document).ready(function () {
 var interval = 10000;
 var refresh = function() {
   var nodes = Object.keys(json.nodes).length;
    for (var i = 0; i < nodes; i++) {
      var num = i + 1;
      var main = 'main.c' + num;
          <th scope="row">${num}</th>
          <td> ${json.nodes[main].online} </td>
          <td> </td>
          <td> </td>
 setTimeout(function() {


1 Answers
Best Answer
AvatarAmit answered 4 months ago
Your Answer

4 + 15 =

Popular Tags

WP Facebook Auto Publish Powered By :