plic_ploc 28 de ago. de 2009
Não sei se entendi o seu problema direito, mas vamos lá!
Se a sua intenção for mudar a página que é exibida no iframe, faça assim:
document . getElementById ( 'id_do_frame' ) . src = 'http://link.com' ;
Com relação ao redimensionamento, o iframe não pode ser redimensionado!
paribe 28 de ago. de 2009
o que estou fazendo não sei o que fazer agora
tenho um html index4.html e tenho o campo temporário ao checar queria
que aparecesse o html index5.html senão index6.html …
Alguém poderia me ajudar como faço o javascript pra isso ou informar um
url ou link pra isso >>>>
alguém pode me ajudar
-- index4 . html
& lt ; html & gt ;
& lt ; head & gt ;
& lt ; META HTTP - EQUIV = "PRAGMA" CONTENT = "NO-CACHE" & gt ;
& lt ; META HTTP - EQUIV = "EXPIRES" CONTENT = "-1" & gt ;
& lt ; script type = "text/javascript" & gt ;
& lt ; / script & gt ;
& lt ; / head & gt ;
& lt ; body & gt ;
& lt ; form & gt ;
& lt ; table width = "530" border = "0" cellspacing = "0" cellpadding = "0" class = "texto" & gt ;
& lt ; tr & gt ;
& lt ; td width = "136" align = "right" & gt ; * Tempor & aacute ; rio : & lt ; / td & gt ;
& lt ; td width = "4" & gt ; & nbsp ; & lt ; / td & gt ;
& lt ; td width = "390" align = "left" & gt ;
& lt ; input type = "checkbox" id = "temporario" name = "temporario" value = "0" onClick = "temp(form.temporario)" & gt ;
& lt ; / td & gt ;
& lt ; / tr & gt ;
& lt ; / table & gt ;
& lt ; / form & gt ;
& lt ; body & gt ;
& lt ; IFRAME src = "index0.html" frameborder = "0" WIDTH = "100%" height = "400" SCROLLING = "no" name = "detalhes2" style = "border: 0px solid #6896A5;" id = "detalhes" & gt ; & lt ; / IFRAME & gt ;
& lt ; / html & gt ;
---------------
-- index5 . html
& lt ; tr & gt ;
& lt ; td width = "155" align = "right" & gt ; * Nome : & lt ; / td & gt ;
& lt ; td width = "5" & gt ; & nbsp ; & lt ; / td & gt ;
& lt ; td width = "400" & gt ; & lt ; input type = "text" name = "nome" id = "nome" value = "" class = "myfield" maxlength = "50" style = "width: 300;" & gt ; & lt ; / td & gt ;
& lt ; / tr & gt ;
-- index6 . html
& lt ; tr & gt ;
& lt ; td width = "155" align = "right" & gt ; * SobreNOme : & lt ; / td & gt ;
& lt ; td width = "5" & gt ; & nbsp ; & lt ; / td & gt ;
& lt ; td width = "400" & gt ; & lt ; input type = "text" name = "sobrenome" id = "sobrenome" value = "" class = "myfield" maxlength = "50" style = "width: 300;" & gt ; & lt ; / td & gt ;
& lt ; / tr & gt ;
plic_ploc 28 de ago. de 2009
Este é um exemplo de um html browser que fiz!!
plic_ploc 28 de ago. de 2009
Você está querendo pegar o conteúdo do iframe e inserir no código do html principal?
paribe 28 de ago. de 2009
valeu obrigado pelo retorno…a idéia era essa que queria…
plic_ploc 28 de ago. de 2009
plic_ploc 28 de ago. de 2009
Faz o download do exemplo!!! Qualquer dúvida posta aqui!!!
paribe 28 de ago. de 2009
Duvida no uso onload=“init();”
Olá,
estou duvida como fazer na hora body pra verificar init()
está me dando erro e não manjo muito de javascript…
erro :
Linha 11
caractere:8
Erro: ‘document.form.temporario’ é nulo ou não é um objeto
pois quando essa página for chamada de outra pagina pode passar o
valor de campo ou não por isso queria verificar seu conteudo …
alguém poderia me ajudar ???
& lt ; html & gt ;
& lt ; head & gt ;
& lt ; META HTTP - EQUIV = "PRAGMA" CONTENT = "NO-CACHE" & gt ;
& lt ; META HTTP - EQUIV = "EXPIRES" CONTENT = "-1" & gt ;
& lt ; script type = "text/javascript" & gt ;
function init () {
if ( document . form . temporario . value . trim () == "" ){
document . getElementById ( 'detalhes' ) . src = 'index6.html' ;
} else {
document . getElementById ( 'detalhes' ) . src = 'index5.html' ;
}
}
function temp ( obj ) {
// alert ( "passo1" );
if ( obj . checked == true ){
document . getElementById ( 'detalhes' ) . src = 'index6.html' ;
} else {
document . getElementById ( 'detalhes' ) . src = 'index5.html' ;
}
}
& lt ; / script & gt ;
& lt ; / head & gt ;
& lt ; body onload = "init();" & gt ;
& lt ; form name = "form>
& lt ; table width = "530" border = "0" cellspacing = "0" cellpadding = "0" class = "texto" & gt ;
& lt ; tr & gt ;
& lt ; td width = "136" align = "right" & gt ; * Tempor & aacute ; rio : & lt ; / td & gt ;
& lt ; td width = "4" & gt ; & nbsp ; & lt ; / td & gt ;
& lt ; td width = "390" align = "left" & gt ;
& lt ; input type = "checkbox" id = "temporario" name = "temporario" value = "0" onClick = "temp(form.temporario)" & gt ;
& lt ; / td & gt ;
& lt ; / tr & gt ;
& lt ; / table & gt ;
& lt ; / form & gt ;
& lt ; body & gt ;
& lt ; IFRAME src = "index5.html" frameborder = "0" WIDTH = "100%" height = "400" SCROLLING = "no" name = "detalhes2" style = "border: 0px solid #6896A5;" id = "detalhes" & gt ; & lt ; / IFRAME & gt ;
& lt ; / html & gt ;
plic_ploc 28 de ago. de 2009
Troque:
onClick="temp(form.temporario)"
por:
onClick="javascript:temp( this )">
plic_ploc 28 de ago. de 2009
troque a linha 39 por:
<form method="POST" id="frm">
e troque a function init por:
function init () {
if ( document .getElementById ( 'frm' ) .temporario .value .trim () == "" ) {
document .getElementById ( 'detalhes' ) .src = 'index6.html' ;
}else {
document .getElementById ( 'detalhes' ) .src = 'index5.html' ;
}
}