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

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

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 Denunciar

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 Denunciar

0

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

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