Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

dumdum

Fechar página já aberta

Recommended Posts

Boa tarde,

 

É o seguinte, tenho uma pagina (ABRIR.html)que tem um botão. Ela abre a página ABERTA.html e a página ABRIR.html depois de abrir a ABERTA.html se redireciona para a FECHAR.html.

 

O problema é o seguinte, a página FECHAR.html tem um botão para fechar a página Aberta.html, queria algum código para que consiga feichar a página ABERTA.html

 

Alguem tem ideia de como faz isso? Botei em javascript porque axo q faz praticamente tudo! xD

 

Aguardo respostas.

 

Obrigado!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tem como postar alguns códigos para a gente ver ?

se você abriu o fechar.html como popup e possivel fechar sim, fora isso dependendo de como você fez, acho q naum da pra fechar ...

 

pq quando você abre a pagina como popup, usando window.open, você consegue referenciar a pagina aberta pela pagina pai, então você consegue fechar ela.

 

 

Se naum me engano e isso.

 

poste aee algumas coisas pra gente ver.

 

abs

Compartilhar este post


Link para o post
Compartilhar em outros sites

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

<script>

function abrir(pagina){

obj=document.getElementById("janela")

txt=obj.innerHTML

 

if(txt=="Abrir"){

janela=window.open(pagina)

obj.innerHTML="Fechar"

}

 

else if(txt=="Fechar")

{

janela.close()

obj.innerHTML="Abrir"

}

 

}

</script>

</head>

 

<body>

<a id="janela" href="java script:abrir('pagina2.html')">Abrir</a>

</body>

</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Página 1

Tem um botão que abre a página 2 e se redireciona para 3

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head>

<title>Página 1</title>

<script language="javascript" type="text/javascript">

function abrir_onclick() {

window.open('Pagina2.html');

window.location="Pagina3.html";

}

</script>

</head>

<body>

<input name="abrir" type="submit" id="abrir" value="Abrir página 2 e redirecionar para a 3" onclick="return abrir_onclick()"/>

</body>

</html>

 

 

Página 2

Vazia sem nada!

Só serve para ser fechada pela página 3

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head>

<title>Página 2</title>

</head>

<body>

</body>

</html>

 

Página 3

Tem um botão que irá fechar a página 2

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head>

<title>Página 3</title>

<script language="javascript" type="text/javascript">

 

</script>

</head>

<body>

<input id="fechar" type="button" value="Fechar página 2"/>

</body>

</html>

 

 

Alguem me ajuda por favor..

 

Preciso entregar esta semana ainda

 

Muito obrigado

 

Att

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.