简体   繁体   中英

How to call pop-up modal from another html file to index file

I have a button to open a form in a Modal. But the Modal is saved in an another.html file. How to call the from that another html file to index.html file with JavaScript.

I can call the Modal from the same file with bootstrap. But don't know how to call it from separate file.

Thing you trying to do is in template engine. Depend of your project you can use eg. twig for PHP, nunjucks for node.js etc.

Other simple way to do this is use component in some of js framework. I think the simplest components you can make in in Vue

Anyway, you have to learn something new, expand your webdevelopment knowledge to make it simple.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM