Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

45
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,

7 months 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 empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.