Link to home
Start Free TrialLog in
Avatar of pha1anx
pha1anxFlag for United States of America

asked on

Can I have the CGI open in the background?

I want to pass form data, but not have my page taken to the CGI script.
Is it possible to have CGI run in the background, possibly in another window that doesn't take focus away from the window that submits the form data?

I'm basically using an html page to store notes.  Therefore I just want to be able to save the data, and not
lose focus on the page or have it reload.

Also.  We use Red Hat, Mozilla/Firefox, and my CGI is in Python.

Thanks in advance.
Avatar of scrathcyboy
scrathcyboy
Flag of United States of America image

My initial thought was "NO", because CGI is a real-time processor that works until it completes, then it releases command of the browser to the previous state before the CGI was called.  So if you want to do this, it probably will work --

1/ set up a hidden Iframe on your web page.  When the form data is complete and is going to be submitted to the CGI, have the CGI send the results to the hidden Iframe.  Then control of the browser will be returned to the main page where the form was submitted.  But the CGI output will be available in the iframe to be retrieved by javascript on the client browser.

Mind you, this is advanced programming.  If you don't understand what I just said above, the answer is NO, you will probably not get this to work, but if you understand it all, then that is the way to make it work
ASKER CERTIFIED SOLUTION
Avatar of pha1anx
pha1anx
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Adam314
Adam314

You could use AJAX.  It is built on javascript, and allows a web browser to send data to a server, and get a response.  This site has very good info on AJAX:
    http://www.w3schools.com/ajax/default.asp