[Javascript] Getting New Data

Peter Brunone peter at brunone.com
Sat Feb 22 20:52:37 CST 2003


Tim,

	I guess I was thinking of Internet Explorer again when I said that; it's
possible to access an HTML element and trigger an event on it, i.e.
document.all.myDiv.click() which activates any scripting associated with
that event on that element.  You could move the data from the hidden frame
(B) to a hidden form field in Frame A, and then set off an event that runs
the processing script.  You'll probably need to keep the header/footer -- or
at least the script blocks -- if you want the browser to regard it as a web
page, but again, IE may let you get away with neglecting things like that.

	Regarding the user's ability to send files from his machine, this would of
course require server-side processing, the implementation of which would
depend on your web server platform.  You'll still have to send it back in
the hidden frame or however you choose.
	Whether or not it helps you, feel free to take a look at
http://aspalliance.com/peterbrunone/chatroom.asp for a bit of
client-to-server-to-different-frame-and-back-again action; perhaps you'll be
inspired by something you see there.  You might even try using a hidden
frame with a javascript source file that gets rewritten every so often, and
the hidden frame could have a meta refresh tag that reloads the frame and
henceforth the javascript (you wouldn't even need a separate source file in
this case, since you'd reload Page_B anyway).

Keep the questions coming!

Peter

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Tim Makins
|
|----- Original Message -----
|From: "Peter Brunone" <peter at brunone.com>
|
|> Tim,
|>..... If not, consider creating a hidden frame that can reload
|>and send its contents to its visible counterpart.  To notify the
|>script that new data has arrived, you could trip some event on
|>the page that you've wired to the positioning function, and
|>you've got it made.
|
|Hi Peter - thanks for your comments. I wonder if you would mind
|expanding on
|your ideas just a little. I can see what you mean about the hidden frame,
|but as to 'sending its contents', and 'trip some event', I'd like to hear
|just a little more.
|
|I came up with an idea of my own: Assume 'Frame_A' is the master, which has
|a link to load 'Frame_B' with page_B.html. I can see page_B.html as
|containing the following:
|
|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|<html><head>
|<SCRIPT SRC="data_processor.js"></SCRIPT>
|</head>
|<body  onload="data_processor()">
|<SPAN ID="data">datadatadatadatadatadatadata</SPAN>
|</body></html>
|
|and this should work, but ideally, I'd like the file to contain only data,
|not the headers/footers as well, though this may be impossible.
|
|Another idea: I wonder if I could use
|
|<FORM name=F1 action="javascript:data_processor();"><input type="file"
|name="data"></FORM>
|
|to let someone locate a datafile on their PC, and get it processed. Has
|anybody tried this ?
|
|Tim in Ireland.
|




More information about the Javascript mailing list