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

170
Visualizações
How can I call client side function from server?

How can I make that if sql query is empty then it does this alert on top of the browser. I tried installing "alert" and it worked but I cant change its UI. I have this funcion on html but I don't know how to call it from my server side script.

function myFunction() {
  alert("Hello! I am an alert box!");
}

This is my server side code right now

connection.query(SQL QUERY) {
            if(err) throw err
        if (rows.length <= 0) {
            alert("This is not what i need")
        }
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can't call alert server-side, because the server does not have a window object.

You should send a message to the client and then call the alert function there.

And besides that, you can't change the UI of the alert dialog box because it's defined by the browser.

over 4 years ago · Santiago Trujillo 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