Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!