Click to See Complete Forum and Search --> : reading returned CGI info...


mikehd
03-27-2003, 04:22 PM
I have a form that runs a cgi script from a server.

The code on the server can't be modified

I get the results in either the same page or a target I specify in the form.

The response contains plain text and overwrites the browser page like so:

error=0
error_text=Successful
version=3.0
aicc_data=
[mainInfo]
variableX=docentsetup
variableY=docentsetup, docentsetup
[specificInfo]

or something like that.

Now I need to be able to read 'variableX' with javascript.

Is this possible??

Ugh,

Thanks in advance...

mikehd
03-28-2003, 08:09 AM
Yes it is. It is on my server. The form action runs a cgi program which then sends the above mentioned data back.

DaiWelsh
03-28-2003, 10:08 AM
For IE browsers you should be able to load it into a frame (hidden if needed) then parse the text in innerHTML of whatever element it is in (body maybe), but I am not sure how easy it would be on NN ? Might also depend whether the cgi script returns a validly formed html document o jsut plain text, not sure whether the dom structure exists for a non-valid html page?

mikehd
03-31-2003, 02:51 PM
Thanks, this kinda of works.

The information loads into the iframe, but when the alert function tries to access it I get an access denied error.

I can't seems to get to the content of the iframe now.

Any suggestions

Cheers

mikehd
04-01-2003, 10:45 AM
Yes sir, you are correct!

I tested this going through the login page on the server and I could read the info!!! (as opposed to just testing the htm pages from the directory).

Now I should be able to parse this and extract what I need.

WWHHHEEEWW.

Thanks for the assistance!!