/    Sign up×
Community /Pin to ProfileBookmark

using javascript to get value from cgi script

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

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@XinSep 09.2003 — 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().
×

Success!

Help @hagai spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...