<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-hljs-tag" style="color:rgb(68,71,70);font-family:"Google Sans Mono",monospace;font-size:14px;white-space:pre"><<span class="gmail-hljs-name">script</span>></span><span class="gmail-javascript" style="color:rgb(68,71,70);font-family:"Google Sans Mono",monospace;font-size:14px;white-space:pre">
  <span class="gmail-hljs-comment">// Função para atualizar a tabela</span>
  <span class="gmail-hljs-function"><span class="gmail-hljs-keyword">function</span> <span class="gmail-hljs-title">atualizarTabela</span>(<span class="gmail-hljs-params"></span>) </span>{
    <span class="gmail-hljs-comment">// Fazer uma solicitação AJAX ao servidor</span>
    $.ajax({
      <span class="gmail-hljs-attr">url</span>: <span class="gmail-hljs-string">"/api/dados"</span>,
      <span class="gmail-hljs-attr">success</span>: <span class="gmail-hljs-function"><span class="gmail-hljs-keyword">function</span>(<span class="gmail-hljs-params">dados</span>) </span>{
        <span class="gmail-hljs-comment">// Atualizar a tabela com os dados recebidos</span>
        $(<span class="gmail-hljs-string">"#tabela tbody"</span>).html(dados);
      }
    });
  }</span></blockquote><div><br></div><div><br></div><div>I want to add this script to the end of my page to keep updating.</div><div>Is it possible to do this, or is it better to put it in the html file? </div></div></div>