Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

111
Visualizações
Check if internet is sending/receiving packets using JavaScript/HTML

I have been making some HTML code to tell me the status of my internet, I have offline and online events set up but I want to check if my internet's sending or receiving packets. How would I do this using JavaScript? I checked everywhere but I can't figure out how to do this in JavaScript. (Thanks in advance!)

Here's my code:

<!DOCTYPE html>
<html>
<body onoffline="myFunction(); myFunction12();" ononline="myFunction1(); myFunction02();"
onpacketsend="myFunction2(); setTimeout(() => {myFunction22}, 300);">

<h3 id="demo1">Online.</h3>

<h3 id="demo2">Sending/Recieving...</h3>

<h3 id="demo">Offline!</h3>


<script>
function myFunction() {
  document.getElementById("demo").style.color = "red";
}

function myFunction1() {
  document.getElementById("demo1").style.color = "green";
}

function myFunction2() {
  document.getElementById("demo2").style.color = "blue";
}


function myFunction02() {
  document.getElementById("demo").style.color = "black";
}

function myFunction12() {
  document.getElementById("demo1").style.color = "black";
}

function myFunction22() {
  document.getElementById("demo2").style.color = "black";
}

</script>

</body>
</html>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It is not currently possible to do with Javascript/HTML. Unfortunatly this means you can only check to see if you are connected to the internet

so I can only:

<body onoffline="myFunction();" ononline="myFunction1();"
">
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda