Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!