Jump to content


Mr_Dores/AJU-SE

Member Since 20/02/2004
Offline Last Active 01/03/2004, 09:12
-----

Posts I've Made

In Topic: Javascript - Que Vale 2 Pontos Para Prova

29/02/2004, 21:18

BOM GALERA... AQUI VAI A RESPOSTA PARA TAL PERGUNTA...


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 (y) :)

In Topic: Javascript - Que Vale 2 Pontos Para Prova

22/02/2004, 11:33

Eu tentei colocar uma função dentro da função para chamar a outra página só que da erro. Eu tinha visto o código da pagina feita pela função, tambem não consegui fazer com que a pagina volta para a inicial.

Obrigado pela atenção

Mr_Dores

IPB Skin By Virteq