I am trying to refresh the page after a cgi execution. In my cgi, a tcp packet is sent to a port. it is called in a hidden iframe. Here is my javascript code:
function xx()
{
iframe = document.getElementById('i');
iframe.src = path+'?'+ac+'-'+type; // it is sth like that "a.cgi?11-1"
location.reload(true);
}
when i disable location.reload cgi works but if i enable it, cgi doesn’t work, no packet is sent. I tried to put sleep between the execution and reload but it didn’t work either.
Is there any other way to refresh the page after cgi execution?
You can set up an
onloadhandler for theiframeso that thereloadwon’t trigger until the iframe has successfully loaded (which should mean your cgi has executed):If you also want a time delay before the reload, you can do this: