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

219
Views
In liferay javascript is not working(user actions are not triggering)

HTML:-

<button type="button" onclick="alert()">Want a greeting?</button>

Javascript:-

function alert(){ alert('working...') }

refference image

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Call your function anything other than alert. It's a reserved keyword, and the error your code gives you is:

InternalError: too much recursion

function handleClick() {
  alert('working...');
}
<button type="button" onclick="handleClick()">Want a greeting?</button>

about 4 years ago · Juan Pablo Isaza Report

0

alert() is a built-in method of JavaScript.

https://developer.mozilla.org/en-US/docs/Web/API/Window/alert

If you change the name of your function that will fix the issue:

function test(){ alert('working...') }
<button type="button" onclick="test()">Want a greeting?</button>

You can override the alert method but you can't recursively call the same function. The issue you're running into is an infinite recursion, you're calling alert > alert > alert > alert > ...

Something like this would work, though.

window.alert = function alert(message){ console.log(message) }
<button type="button" onclick="alert('test')">Want a greeting?</button>

about 4 years ago · Juan Pablo Isaza Report

0

<button type="button" onclick="click()">Want a greeting?</button>

<script> let click = () => {alert('working...');}</script>
about 4 years ago · Juan Pablo Isaza 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!