What I do with javascript is to have an object tag on the page I want
to load .txt data onto, such as:
<Xdiv>
<Xobject id="objname" width="800" height="300" type="text/html"
data="file:///C:/proof/zinner.html" border="1" >
<X/object>
<X/div>
This loads a second html file [zinner.html] onto the page.
In zimmer.html I have something like the following:
<XSCRIPT id="zlemon" language=javascript type=text/javascript>
<X/SCRIPT>
This script has an id (zlemon) and acts as a target. Also on the page
is:
<Xform name=formGetFile >
<Xinput type=file name="fgf">
<Xinput type=button onClick="getScript()" value="Get Data">
<X/form>
This will allow you to select a file to open, and then trigger the
'get file' operation.
<Xscript>
function getScript() {
zfilaN = document.formGetFile.fgf.value;
k=zfilaN.lastIndexOf('\\');
zfilaN=zfilaN.substring(k+1);
document.getElementById("zlemon").src = zfilaN;
var tid = setTimeout("alert(zfila); window.location.reload();",3000);
};
<X/script>
Basically it strips the drive and directory info to leave the filename
of the file you want to open. Then it sets the src to the script
id='zlemon'... and then it waits for a few seconds just to make sure
that the browser has enough time to access the file you have chosen (i
have used an alert to display the value I wanted retrieved from the
txt file) and then it does a reload to stop the timer and reset
everything.
I have added 'X' to the tag names in case it tries to parse it as html
in the email.
It's crude, but it works in both IE and Firefox. Instead of the alert
you could use something like parent.x = zfila to push the variable
into the parent html file, where 'x' is some variable you have
previously defined in the parent file.
Trevor