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

191
Vistas
Is there a way to open the same modal from different js files?

Is there a way to open the same modal in a single html page from two different js files?

Assuming that I am in the homepage now, when i click a nav button, it calls the openModal function and it should show me the modal below.

Hompage.html

<div id="Homepage-modal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="cart-container">
                <div @click="goToStore()">
                    <div class="button">Click Me</div>
                </div>
            </div>
        </div>
    </div>
</div>

Homepage.js

function (openModal){
    $('#Homepage-modal').modal('show');
}

is there a way for me to click the same button on a different page with a different js file to bring up the same modal from homepage.html without copying and pasting the modal into menu.html

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could put the modals HTML in a subcomponent 'modal' and call that component in the HTML of the component, that you want to display that modal with <modal></modal>.

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