< Html >
< Head >
< Title > JS operationsCompositionThis document </ Title >
</ Head >
< Body >
< Script >
VaR Arr = New Array ();
Arr [ 0 ] = [ 0 , " Name0 " , " Value0 " ];
Arr [ 1 ] = [ 1 , " Name1 " , " Value1 " ];
Arr [ 2 ] = [ 2 , " Name2 " , " Value2 " ];
Arr [ 3 ] = [ 3 , " Name3 " , " Value3 " ];
Arr [ 4 ] = [ 4 , " Name4 " , " Value4 " ];
Function Write2text ()
{
VaR FSO = New Activexobject ( " Scripting. FileSystemObject " );
VaR F = FSO. createtextfile ( " A.txt " , True );
For ( VaR I = 0 ; I < Arr. length; I ++ )
{
F. Write (ARR [I])
F. writeblanklines ( 1 )
}
F. Close ();
}
</ Script >
< Input Type = Button Value = "Write" Onclick = "Write2text ()" >
< Script >
Function Getheader (SRC ){
VaR Forreading = 1 ;
VaR FSO = New Activexobject ( " Scripting. FileSystemObject " );
VaR F = FSO. opentextfile (SRC, forreading );
Return (F. readall ());
}
Function Readtext (){
VaR Arr = Getheader ( " A.txt " ). Split ( " \ R \ n " );
For ( VaR I = 0 ; I < Arr. length; I ++ ){
Alert ( " The " + (I + 1 ) + " The row data is: " + Arr [I]);
}
}
</ Script >
<InputType= ButtonValue= "Read"Onclick= "Readtext ()">
</Body>
</Html>