Foros del Web » Programando para Internet » Javascript »

eliminar un frame, dejar otro

Estas en el tema de eliminar un frame, dejar otro en el foro de Javascript en Foros del Web. hola, tengo un script en php que me abre los enlaces en un frameset, como en este sitio, y me gustaría que los usuarios pudieran ...
  #1 (permalink)  
Antiguo 06/05/2002, 16:32
itatpc
Invitado
 
Mensajes: n/a
Puntos:
eliminar un frame, dejar otro

hola, tengo un script en php que me abre los enlaces en un frameset, como en este sitio, y me gustaría que los usuarios pudieran cerrar el frame superior (donde pongo algunas cosillas mías). Si alguien sabe cómo podría hecerlo, pués muchas gracias.

P.D.: ya utilicé el buscador y no he encontrado nada (tan sólo un mensaje, pero no funciona).

Saludos!!!
  #2 (permalink)  
Antiguo 07/05/2002, 02:22
Avatar de JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Re: eliminar un frame, dejar otro

Hola, itatpc.

Cerrar no se si se puede. Lo que si puedes hacer es cambiar el tamaño del frame y dejardo a cero. Esto está copiado de este mismo Foro:

<A HREF="JavaScript:parent.frame_feo.rows = '0,*';...

Espero que te sirva. Saludos,

---------------
Pregunta lo que ignoras y pasarás por ton.to 5 minutos.
No lo preguntes y serás ton.to toda la vida.
  #3 (permalink)  
Antiguo 10/06/2002, 21:13
itatpc
Invitado
 
Mensajes: n/a
Puntos:
Re: eliminar un frame, dejar otro

pués no, no sirvió

de todas formas encontré un script en perl que sí incluía dicha función :)

pero muchas gracias por tu ayuda y suerte ;)
  #4 (permalink)  
Antiguo 10/06/2002, 21:45
Avatar de cauly  
Fecha de Ingreso: febrero-2002
Ubicación: Buenos Aires
Mensajes: 726
Antigüedad: 22 años, 2 meses
Puntos: 0
Re: eliminar un frame, dejar otro

ITATPC, ¿PODRIAS POSTEAR EL SCRIPT EN PERL QUE ENCONTRASTE?

<center>
<iframe src='http://www.publicasonline.com/banner/banner.html' width=468 height=60 frameborder=no scrolling=no></iframe>
  #5 (permalink)  
Antiguo 10/06/2002, 22:00
itatpc
Invitado
 
Mensajes: n/a
Puntos:
Re: eliminar un frame, dejar otro

pués sí, claro, pero no tengo el original, así que te tendrás que conformar lo que tengo (de todas formas he cambiado algo)

Código:
#!/usr/bin/perl
##################################################################################
# Frame Redirector
#                               
# Allow you to redirect users to specifed URL with frame with your additional
# info or ADS
#
# Can work with Links 2.0 script or analogic.
#
# You can add any custom values to ADS frame
#
# By Alexey Habibulin --&gt; http://www.mycgiscripts.com/
#                     All rights reserved                      `
#
# For installation of cgi scripts or any custom works email to [email protected]
#
##################################################################################
#Modify here. Please don't forget to change template with frame at end of file

# Log redirects? If yes, change to unix/nt path to log file

$log=&quot;&quot;;

#size of top frame %

$top=&quot;27&quot;;

#size of bottom frame %

$bottom=&quot;*&quot;;

#It all variables to modify. Don't forget to edit html text of frame
#in end of this file
################################################################################
%in=&amp;parse;

@framehtml=&lt;DATA&gt;;

if (!$in{'url'}) {error(&quot;URL is not specifed!&quot;);}

if ($in{'step'}) {&amp;show_topframe;exit;}

&amp;show_frames_page;

exit;

sub show_frames_page{
#all variables.

if ($log) {&amp;logger;}

$all=&quot;&quot;;

foreach $item (keys %in) { $all.=&quot;&amp;$item=$in{$item}&quot;; }

print &quot;Content-type: text/html\n\n&quot;;
print qq~
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Todos los enlaces están en sitio - $in{'url'}&lt;/title&gt;
&lt;/head&gt;
&lt;frameset rows=&quot;$top,$bottom&quot; border=&quot;0&quot;&gt;
  &lt;frame name=&quot;header&quot; scrolling=&quot;no&quot; target=&quot;main&quot; src=&quot;ir.cgi?step=1$all&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; noresize&gt;
  &lt;frame name=&quot;main&quot; src=&quot;$in{'url'}&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;auto&quot;&gt;
  &lt;noframes&gt;
  &lt;body&gt;
  &lt;p&gt;¡A ver si
sigue...
  #6 (permalink)  
Antiguo 10/06/2002, 22:02
itatpc
Invitado
 
Mensajes: n/a
Puntos:
Re: eliminar un frame, dejar otro

Código:
actualizamos el navegador! Este sitio utiliza marcos pero tu navegador no los soporta.&lt;/p&gt;
&lt;center&gt;[Pincha &lt;a href=&quot;$in{'url'}&quot;&gt;aquí&lt;/a&gt; para acceder al contenido]&lt;/center&gt;
  &lt;/body&gt;
  &lt;/noframes&gt;
&lt;/frameset&gt;
&lt;/html&gt;
~;
exit;
}


sub parse{my (@pairs, %in);my (@pairs, %in);my ($buffer, $pair, $name, $value);if ($ENV{'REQUEST_METHOD'} eq 'GET') {@pairs = split(/&amp;/, $ENV{'QUERY_STRING'});}elsif($ENV{'REQUEST_METHOD'} eq 'POST') {read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});@pairs = split(/&amp;/, $buffer);}PAIR: foreach $pair (@pairs) {($name, $value) = split(/=/, $pair);$name =~ tr/+/ /;$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;$value =~ tr/+/ /;$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;exists $in{$name} ? ($in{$name} .= &quot;~~$value&quot;) : ($in{$name}  = $value);}return %in;}sub show{my $text;$text = shift;$logo = qq~&lt;p align=center&gt;&lt;font face=&quot;Verdana&quot; size=&quot;2&quot;&gt;Powered by &lt;a href=&quot;http://www.mycgiscripts.com/&quot;&gt;mycgiscripts.com&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;/html&gt;~;if ($text !~ /mycgiscripts\.com/i) {		if ($text !~ /\&lt;\/HTML\&gt;/i || $text !~ /\&lt;\/html\&gt;/i) {$text.=$logo;}else{$text =~ s/&lt;\/html&gt;/$logo/;}}return $text;}sub error{$message=shift;print &quot;Content-type: text/html\n\n&quot;;print show(&quot;&lt;b&gt;&lt;center&gt;Error :&lt;/b&gt; $message&lt;/center&gt;&quot;);exit;}

sub logger{
unless(-e &quot;$log&quot;) { open(OUT,&quot;&gt;$log&quot;) or die &quot;cannot create $log : $!&quot;;
			print OUT &quot;&quot;;
				close OUT;
			}

open(SLOG,$log) or error(&quot;Error opening $log : $!&quot;);
@lines=&lt;SLOG&gt;;
close(SLOG);

foreach $link(@lines)
	{
	chomp($link);
	($linker,$hits)=split(/\|/,$link);
	$linker_array{$linker}=$hits;
	}

	$linked_site=$in{url};

$linker_array{$linked_site}++;

{@keys=sort {$linker_array{$a} &lt;=&gt; $linker_array{$b}} keys(%linker_array)}
sigue...
  #7 (permalink)  
Antiguo 11/06/2002, 17:48
itatpc
Invitado
 
Mensajes: n/a
Puntos:
Re: eliminar un frame, dejar otro

Código:
open(SLOG,&quot;&gt;$log&quot;) or error(&quot;Cannot save log : $!&quot;);
foreach $key(@keys)
{
print SLOG qq~$key|$linker_array{$key}\n~;
}
close(SLOG);

return;
}
sub show_topframe{
print &quot;Content-type: text/html\n\n&quot;;
foreach $r (@framehtml) {$r =~ s#\$in\{\'(.*?)\'\}#$in{$1}#gsi; print $r;}
exit; 
}

#################################################################################
# Modify top frame HTML here!
#
# You can use any additional variables. Example
# Call the script - http://mydomain.com/cgi-bin/frames.cgi?url=http://www.yahoo.com&amp;return=http://www.mydomain.com
#
# After it return variable will be accessible here as $in{'return'}
# using this rule, you can use unlimited additional values for top frame
# Please modify html after __END__. string. 
#######################################################################################
__END__.
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Marco superior de sitio.com&lt;/title&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://www.sitio.com/a-estilos.css&quot; type=&quot;text/css&quot;&gt;
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
&lt;!--
function favoritos()
{
if (window.external)
external.AddFavorite(&quot;$in{'url'}&quot;, &quot;$in{'url'}&quot;)
else
alert(&quot;Lo siento, pero tu navegador no soporta esta característica. Debes añadir el sitio a tus favoritos manualmente o pulsando Ctrl+D.&quot;);
}
// --&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body onmouseover=&quot;window.status='sitio'; return true;&quot; bgcolor=&quot;#990066&quot;&gt;
&lt;script language=&quot;JavaScript&quot; src=&quot;http://www.sitio.com/a-funcionesSIN.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; width=&quot;100%&quot; bgcolor=&quot;black&quot;&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;#666666&quot; style=&quot;text-align:center;&quot;&gt;&lt;p&gt;&lt;b&gt;sitio.com&lt;/b&gt; no se hace responsable del contenido de este sitio - &lt;font color=&quot;black&quot;&gt;&amp;raquo;&lt;/font&gt; &lt;a href=&quot;javascript:favoritos();&quot; class=&quot;menu&quot;&gt;A&amp;ntilde;adir a Favoritos&lt;/a&gt; &lt;font color=&quot;black&quot;&gt;&amp;raquo;&lt;/font&gt;
sigue...
  #8 (permalink)  
Antiguo 11/06/2002, 17:50
itatpc
Invitado
 
Mensajes: n/a
Puntos:
Re: eliminar un frame, dejar otro

Código:
&lt;a target=&quot;main&quot; href=&quot;http://www.sitio.com/cgi-bin/enviar/mailpage.cgi?url=$in{'url'}&quot; class=&quot;menu&quot;&gt;Recomendar&lt;/a&gt; &lt;font color=&quot;black&quot;&gt;&amp;raquo;&lt;/font&gt; &lt;a target=&quot;_top&quot; href=&quot;$in{'url'}&quot; class=&quot;menu&quot;&gt;Cerrar marco&lt;/a&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td bgcolor=&quot;#990066&quot; style=&quot;text-align:center;&quot;&gt;&lt;p&gt;¿Amistad? ¿Amor? ¿Sexo? ¡Envía al y encuentra lo que buscas!&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
pués nada, espero que te sirva para algo y si tienes algún problema al copiarlo me lo dices.

Al principio del todo viene la url del sitio de donde te lo puedes bajar, y ahora pienso que quizás hubiera sido más fácil hab´rtela pasado en lugar de postear todo esto, pero bueno, lo hecho, hecho está...

un saludo y suerte ;)
  #9 (permalink)  
Antiguo 12/06/2002, 11:23
Avatar de Yasakani  
Fecha de Ingreso: enero-2002
Ubicación: Cuautitlan Izcalli, Mex.
Mensajes: 28
Antigüedad: 22 años, 3 meses
Puntos: 0
Re: eliminar un frame, dejar otro

Hola!!! Mi problema tambien es con un frame,me pueden ayudar porfavor:
Bueno saque una cuenta en i(espana) y lo que no me gusta :( es que a mi pagina le ponen un frame en la parte de abajo y no se como quitarselo,ya que este frame estropea la visibilidad de la pagina.
Por favor si me podrian ayudar con un script para quitar la publicidad en frames.
GRACIAS.

<a href="http://www.thekof.spydar.com/" target="_blank"><img src="http://www.galeon.com/yasakani/voto_logo.gif"></a>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:09.