I'm trying to implement a portal with revenue, expenses, etc. I am using iframes
to bring the information from the server. It works fine until I realize that loading all iframes
all at once shuffles the functions of every iframe
because when it loads a iframe
, it loads all functions within the function.
I then need a code that makes iframe
open at the time of the click and download to close it.
window.onload = function() {
//Receitas
document.getElementById("iframe1").src="LINK_IFRAME1";
document.getElementById("iframe2").src="LINK_IFRAME2";
//Despesas
document.getElementById("iframe3").src="LINK_IFRAME3";
document.getElementById("iframe4").src="LINK_IFRAME4";
document.getElementById("iframe5").src="LINK_IFRAME5";
document.getElementById("iframe6").src="LINK_IFRAME6";
}
In html I'm bringing them like this:
<div class="modal fade" id="ingresso-de-receitas">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" class="blank" title="Fechar" data-dismiss="modal" aria-label="Fechar"><span aria-hidden="true">×</span></button>
<h2 class="modal-title">Ingresso de receitas</h2>
</div>
<div class="modal-body text-center">
<iframe id="iframe1" width="100%" height="900px" frameborder="none"></iframe>
</div>
</div>
</div>
</div>
Does anyone have any idea how to solve it?