Click to See Complete Forum and Search --> : using javascript to get value from cgi script


hagai
09-09-2003, 01:19 PM
Hi, i got a small problem.

I have a cgi script which returns a specific, but changing number. ie. i call the script and it returns a 5, next time i call it it may return a 8.

What i want to do is store this number in a var in my javascript. It doesnt matter if the number is stored in the form of a string, i just need to know how i can assign the value of a returned value from a cgi script to a javascript var.

So i have http://www.whatever.com/cgi-bin/retNum.cgi and i want to do var num = the value from the above script.

Is there any way of doing this?

Thanks

Hagai

Xin
09-09-2003, 01:43 PM
i havent tested it but the thought is to let your cgi return

<script language='javascript'>var num=5</script>

and call it via iframe.src or layer.load().