An iframe is not something that "opens" in the same way that a window opens. It is an HTML tag that you insert into the page and load another page.
What you can do is insert the tag where you want it on the page without specifying a URL and hidden with display: none;
:
<iframe style="display: none;"></iframe>
In the function you change the visibility of iframe
and set a src
that will be the page to be loaded:
function MostraBarra(){
if (document.incluir.balancete_arquivo.value != ""){
// window.open('<%=BARRASTATUS%>','upload','width=400,height=150');
var iframe = document.querySelector("iframe"); // seleciona o iframe pela tag
iframe.style.display = "block"; // altera o display tornado-o visível
iframe.src = "<%=BARRASTATUS%>"; // carrega uma página no iframe
}
return true;
}
Then you can set styles of iframe
via CSS any way you want:
iframe{
width: 100%;
height: 400px;
border: none;
}
Other properties of iframe
you can check in MDN documentation .