Fazer Uma Pagina Carregar Dentro De Um Div
Started By
leanjo
, 15/08/2006, 19:27
20 replies to this topic
#1
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?
com js, ou ajax, ou qq coisa do genero... tem como fazer uma pagina carregar dentro de um div?
- HaroNism likes this
#2
Posted 15/08/2006, 19:57
Sim, com AJAX (que é JS) ou mesmo com um simples iframe...
#3
Posted 15/08/2006, 20:25
mas como...
algum exemplo?
algum exemplo?
#4
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
Contato: julio.greff [at] gmail [dot] com
Habilidades: JavaScript, Ajax, PHP, XHTML, CSS, MySQL, POO
Blog: http://www.juliogreff.blog.br
#5
Posted 15/08/2006, 20:46
e como fica o link?
nao sei quase nada de ajax...
valeu
nao sei quase nada de ajax...
valeu
#6
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
Contato: julio.greff [at] gmail [dot] com
Habilidades: JavaScript, Ajax, PHP, XHTML, CSS, MySQL, POO
Blog: http://www.juliogreff.blog.br
#7
Posted 15/08/2006, 22:37
continuei sem entender
tipo
tneho um link pagina1 - como fica esse link?
falou
tipo
tneho um link pagina1 - como fica esse link?
falou
#8
Posted 15/08/2006, 23:26
#9
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
http://www.nerddisse.com - O Lado mais nerd da Internet
Twitter: www.twitter.com/vrleonel
#10
Posted 16/08/2006, 12:52
Não obtive sucesso com teu código Vitor loko.
http://www.triko.com.br
#11
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...
É 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
http://www.nerddisse.com - O Lado mais nerd da Internet
Twitter: www.twitter.com/vrleonel
#13
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
0 user(s) are reading this topic
0 membro(s), 0 visitante(s) e 0 membros anônimo(s)