Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda