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

140
Vistas
How to call a Javascript function in an attribute of an element

I'm working in laravel php and have blade.php views,

I have the following component which is used in blade.php as follows

<x-form.select
            wire:model.defer="state.trip_destination"
            :search="true"
            x-search="
                (query) => {
                    return new Promise((resolve, reject) => {
                        resolve(fun()); //HERE
                    });
                }
            "
            name="state.trip_destination"
            type="text"
            id="trip-destination"
        />

Now I want to call the function fun() which is just returning a string, and is defined as

<script>
function fun()
{
    return "HELEL";
    debugger;
};
</script>

It doesn't goes to that function because it is out of scope, is there any way to solve this problem.

Thanks,

about 4 years ago · Juan Pablo Isaza
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