Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/08/2003, 04:13
furoya
(Desactivado)
 
Fecha de Ingreso: noviembre-2002
Ubicación: Ciudad Autónoma de Buenos Aires
Mensajes: 2.367
Antigüedad: 21 años, 5 meses
Puntos: 317
Hola emejia :

No. Mucho no entiendo. Estás pidiendo un código que ya posteaste. A menos que tengas solamente esas partes sueltas y no sepas cómo juntarlas y que funcionen.

Si por "click en un titulo" te refieres a las opciones del select, ésto te puede servir.


Busca.html

Código:
<HTML>
<HEAD>
<SCRIPT>
function leer()
{
var y, otraVentana;
var untitulo=frm.titulos.value;
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.OpenTextFile("RUTA_ABSOLUTA/datos.txt",1);
contents = f.ReadAll();

pos_inicial = contents.indexOf(untitulo+"[") + 6; 
pos_final = contents.indexOf("]"+untitulo); 
y = contents.substring(pos_inicial,pos_final); 

otraVentana= window.open("", "contenidos", "height=300, width=450, "+
"resizable=0, noresize=no, toolbar=0, location=0, directories=0, "+
"status=0, menubar=0, scrollbars=yes");
otraVentana.focus();
otraVentana.document.write("<title>CONTENIDOS. </title>"); 
otraVentana.document.write(y); 
otraVentana.document.close(); 
}

</SCRIPT>
</HEAD>
<BODY>

<p>_<p>
<form name=frm>
<select name=titulos>
<option value=00000 selected>INTRODUCCIÓN.
<option value=00001>TÍTULO 1.
<option value=00002>TÍTULO 2.
<option value=00003>TÍTULO 3.
<option value=00004>TÍTULO 4.
<option value=00005>TÍTULO 5.
</select> _ 
<input type=button value="Ver" onclick=leer()>
</form>

</BODY>
</HTML>
datos.txt

Código:
00000[ 
<h1><u>INTRODUCCION.</u></h1> Ésta es la introducción.]00000
00001[ 
<h2>ÉSTE ES EL TÍTULO 1.</h2> Contenido... ]00001
00002[ 
<h2>ÉSTE ES EL TÍTULO 2.</h2> Contenido... ]00002
00003[ 
<h2>ÉSTE ES EL TÍTULO 3.</h2> Contenido... ]00003
00004[ 
<h2>ÉSTE ES EL TÍTULO 4.</h2> Contenido... ]00004
00005[ 
<h2>ÉSTE ES EL TÍTULO 5.</h2> Contenido... ]00005
Saludos
furoya.