FICA UM CODIGO "EXEMPLO.JS" EXTERNO QUE RECEBE AS FUNÇÕES E UMA PAGINA HTML QUE CHAMRA AS FUNÇÕES. SAO ELAS:
ARQUIVO FUNCOES.JS
==============================================
function botoes() {
document.write (" <input type='button' onclick='pag1()' value='Pagina 01' /> " +
" <input type='button' onclick='pag2()' value='Pagina 02' /> " +
" <input type='button' onclick='pag3()' value='Pagina 03' />");
document.write (" <script src='funcoes.js'></script>" );
}
function pag1() {
document.open();
document.write("<html><body>Pagina 1" + "<br>");
document.write("**" + "<br>");
document.write("****" + "<br>");
document.write("******" + "<br>");
document.write("********" + "<br>");
document.write("**********" + "<br>");
document.write("</body></html>");
botoes();
}
function pag2() {
document.open();
document.write("<html><body>Pagina 2" + "<br>");
document.write("**" + "<br>");
document.write("****" + "<br>");
document.write("******" + "<br>");
document.write("********" + "<br>");
document.write("**********" + "<br>");
document.write("</body></html>");
botoes();
}
function pag3() {
document.open();
document.write("<html><body>Pagina 3" + "<br>");
document.write("**" + "<br>");
document.write("****" + "<br>");
document.write("******" + "<br>");
document.write("********" + "<br>");
document.write("**********" + "<br>");
document.write("</body></html>");
botoes();
}
===============================================
ARQUIVO QUESTAO.HTML
===============================================
<html>
<head>
<script src="funcoes.js">
</script>
<title>-----cadastro aluno-----</title>
</head>
<body>
<h3>CORPO</h3><br/><br/><br/><br/>
<form>
<input type="button" value="Pag 1" onclick="pag1()" />
<input type="button" value="Pag 2" onclick="pag2()" />
<input type="button" value="Pag 3" onclick="pag3()" />
</form>
</body>
</html>
=================================================
VALEU PELA FORÇA

