Jump to content


Photo

Fazer Uma Pagina Carregar Dentro De Um Div


  • Faça o login para participar
20 replies to this topic

#1 leanjo

leanjo

    Doutor

  • Usuários
  • 912 posts
  • Sexo:Não informado
  • Interesses:...

Posted 15/08/2006, 19:27

opa
com js, ou ajax, ou qq coisa do genero... tem como fazer uma pagina carregar dentro de um div?

#2 Klaus

Klaus

    @ ubuntu jaunty

  • Ex-Admins
  • 7924 posts
  • Sexo:Masculino
  • Localidade:127.0.0.1

Posted 15/08/2006, 19:57

Sim, com AJAX (que é JS) ou mesmo com um simples iframe...
Klaus Paiva
Conheça também: Taperás

#3 leanjo

leanjo

    Doutor

  • Usuários
  • 912 posts
  • Sexo:Não informado
  • Interesses:...

Posted 15/08/2006, 20:25

mas como...
algum exemplo?

#4 JulioGreff

JulioGreff

    Feel Free!

  • Usuários
  • 390 posts
  • Sexo:Não informado
  • Localidade:localhost
  • Interesses:JavaScript, Ajax, POO, etc. etc. etc.

Posted 15/08/2006, 20:33

Tem uns tutoriais mais explicados aí no fórum, mas aí vai um código:

var xmlhttp;
if(window.XMLHttpRequest) {
  try {xmlhttp = new XMLHttpRequest();} catch(e) { xmlhttp = false; }
}
else if(window.ActiveXObject)
{
  try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {
  try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlhttp = false; } }
}

function results() {
  if(xmlhttp.readyState==4) {
	ajaxOutput();
	xmlhttp.abort();
  }
  else if(xmlhttp.readyState==1) {
	  loadingAjax();
  }
}
function ajax() {
if(xmlhttp) {
  xmlhttp.onreadystatechange = function() { results(); };
  xmlhttp.open("GET", "page", true);
  xmlhttp.send("");
}
}

function loadingAjax() {
	var loadMessage = "<b>Carregando...</b>";
	document.getElementById('body').innerHTML = loadMessage;
}
function ajaxOutput() {
	var xml = xmlhttp.responseText;
	document.getElementById('body').innerHTML = xml;
}

Júlio Greff de Oliveira - Always a JavaScripter...
Contato: julio.greff [at] gmail [dot] com

Habilidades: JavaScript, Ajax, PHP, XHTML, CSS, MySQL, POO
Blog: http://www.juliogreff.blog.br

#5 leanjo

leanjo

    Doutor

  • Usuários
  • 912 posts
  • Sexo:Não informado
  • Interesses:...

Posted 15/08/2006, 20:46

e como fica o link?
nao sei quase nada de ajax...
valeu

#6 JulioGreff

JulioGreff

    Feel Free!

  • Usuários
  • 390 posts
  • Sexo:Não informado
  • Localidade:localhost
  • Interesses:JavaScript, Ajax, POO, etc. etc. etc.

Posted 15/08/2006, 21:03

O link fica ali onde está escrito "page", esqueci de sinalizar melhor.
xmlhttp.open("GET", "page", true);

Júlio Greff de Oliveira - Always a JavaScripter...
Contato: julio.greff [at] gmail [dot] com

Habilidades: JavaScript, Ajax, PHP, XHTML, CSS, MySQL, POO
Blog: http://www.juliogreff.blog.br

#7 leanjo

leanjo

    Doutor

  • Usuários
  • 912 posts
  • Sexo:Não informado
  • Interesses:...

Posted 15/08/2006, 22:37

continuei sem entender
tipo
tneho um link pagina1 - como fica esse link?

falou

#8 Cristiano Galdino

Cristiano Galdino

    Dark Defender

  • Administradores
  • 3738 posts
  • Sexo:Masculino
  • Localidade:Brasília, DF

Posted 15/08/2006, 23:26

http://forum.wmonlin...&...st&p=751210
Veja o nexo.
Cristiano Galdino
- http://cristiano.galdino.net/

“Since 2003”


#9 Vitor_loko

Vitor_loko

    Perguntador profissional

  • Usuários
  • 176 posts
  • Sexo:Não informado

Posted 16/08/2006, 11:37

Sim, com AJAX (que é JS) ou mesmo com um simples iframe...


Tem um jeito de Fazer com Iframe

Eu uso como uma pop-Up no meu Sistema...

Vai aí como eu fiz.... algumas coisas são do Recurso de Arrastar e Fechar a pop-Up

<head>
<style type="text/css">
	#pesquisa {
	position:absolute;
	height:250px;
	width:300px;
	background-color:#FFFFFF;
	border:  2px solid #333;
		}
			#janPesquisa {
		margin:0px;
		padding:2px;
		width:296px;
		font-weight:bold;
		color:white;
		background-color:#007F7F;
		font-family:verdana, sans-serif;
		font-size:10px;
		border-bottom:2px solid #333;
		cursor:pointer;
		}
 </style>
<script language="javascript" type="text/javascript">
// Começo--------
function fechaPesquisa()
{
PopUp.history.go(-1);
document.getElementById('pesquisa').style.display='none';


}

// Fim-----------
</script>
</head>
<body>
<div id="pesquisa" style="display:none; left:325px; top:36px; z-index:4;">
 <div id='janPesquisa' style="background: url(imagem/barrinha_menu_padrao.jpg)";> 
   <table width="100%"  border="0" cellspacing="0" cellpadding="0">
	 <tr>
	   <td width="92%" class="branco">Pesquisa</td>
	   <td width="8%"><a href='#' onclick=fechaPesquisa() class="branco"> [X]</a></td>
	 </tr>
   </table>
  </div>
 
 <table width="100%"  border="0" cellpadding="0" cellspacing="0">
   <tr>
	 <td ><iframe name="PopUp" id="PopUp" src="pagina1.htm" height="231" frameborder="0"></iframe></td>
	</tr>
 </table>

</div> 
</body>

a Página que vc quer abrir fica ali no Iframe no src.

Qualquer Dúvida sobre o Código é só me avisar...
Vitor
http://www.nerddisse.com - O Lado mais nerd da Internet
Twitter: www.twitter.com/vrleonel

#10 triko

triko

    Turista

  • Usuários
  • 55 posts
  • Sexo:Não informado
  • Localidade:POA/RS

Posted 16/08/2006, 12:52

Não obtive sucesso com teu código Vitor loko.
http://www.triko.com.br

#11 Vitor_loko

Vitor_loko

    Perguntador profissional

  • Usuários
  • 176 posts
  • Sexo:Não informado

Posted 16/08/2006, 13:50

O que Aconteceu?

É que eu postei aí meu código e talz...

mas é assim...

cria uma Div com um nome e um id, o style position dela tem que estar em absolute, defina o lugar onde ela vai aparecer com left e Top e entro das tags
<div></div> Coloque um Iframe, espeficicando a página que vc quer abrir...

Simples...
Vitor
http://www.nerddisse.com - O Lado mais nerd da Internet
Twitter: www.twitter.com/vrleonel

#12 HaroNism

HaroNism

    Super Veterano

  • Usuários
  • 15385 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 27/09/2017, 04:49

Dapoxetina Tadalafil Prix De Cialis En France Cialis V Viagra cialis On Line Fedex Shipping Provera

#13 Miguceamma

Miguceamma

    MiguPenjisse

  • Usuários
  • 13201 posts

Posted 27/09/2017, 11:25

Free Shipping Generic Pyridium In Usa Acheter Cialis Sur Internet Generic Bentyl In Canada Without A Script Pharmacy Fedex cialis price Propecia En Hombres Vet Prescribed Cephalexin Pharmacy Prices For Levitra

#14 HaroNism

HaroNism

    Super Veterano

  • Usuários
  • 15385 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 09/10/2017, 07:57

Levitra Generico Vendita viagra Achat Viagra Pour Homme
Achat Tadalis Sx 40 Mg Amoxicillin Liver Damage Cialis Kaufen In Deutschland viagra Propecia Vitamins

#15 HaroNism

HaroNism

    Super Veterano

  • Usuários
  • 15385 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 24/10/2017, 20:47

Fluoxetine 20 Mg Buy Buy Synthroid Online No Rx Kamagra Is It Legal In Uk viagra Progesterone Purchasing Discount Cash On Delivery Online Provera Stirling
Where I Can Buy Ropinirole 2 Lasix Without Prescription Overnight viagra Precio De Propecia




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq