Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

186
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda