jason_box a écrit :
you'll need to create your function doCallServer()
i.e : to submit your form nammed 'myForm'
function doCallServer() {
document.forms['myForm'].submit(); }
I think I got a little confused with this. The javascript will handle
the timing of calling to the cgi script, so when the button is pressed,
it triggers the event to the cgi and the javascript can be made so that
it will call the script x-mount of minutes.
I have a little problem with your deal :
"javacript be activated by an input button that would call to a cgi
program and querey every 10minutes and the cgi would update the page"
here ___________________________________________^^^^^^^^^^^^^^^^^^^^^
As I unterstand your cgi loads back same page (with some adds on?)
On each new load the previous Javascript is forgotten ... :-(
If you need a JavaScript to update sequentially a page, this page has to
be displayed in an other viewport (window or frame or iframe).
You may also use XMLHttpRequest to modify (on the fly) a part of your
page but this way of doing is not very easy, overall if you aren't
familiar with JavaScript.
ask XMLHttpRequest to Google
Now I can see what the
doCallServer() would do, but I'm confused on why a
documents.form['myForm'].submit() would be needed?
That is an answer to your precedent post where you talk about form.
Wouldn't that mean I
have a form with data to pass to the cgi? In my case I have no data to
pass to the cgi, I only call to it
To call it you need a button with an onclick or a link or an action's
form, no ?
and it does its job and I just need
to know the segment of code that will return the location of where the
output will be on the main index.html page.
<html>
<h1>my main page</h1>
<form>
<input type=button name="start" value="Start"
onclick="if(parent.myFrame)
tmp=setInterval('parent.myFrame.location=\'/cgi/foo.cgi\'',600000);
else alert('browser non compatible');
this.disabled=true;
stop.disabled=false;
">
<input type=button name="stop" value="Stop" disabled
onclick="clearInterval(tmp);
this.disabled=true;
start.disabled=false;">
</form>
<iframe name="myFrame" src="/cgi/foo.cgi" width=500 height=400>
Your browser doesn't know iframes, click <a href="/cgi/foo.cgi">here</a>
</iframe>
</html>