Peter: JavaScript cgi call with return value

Beitrag lesen

I have a cgi script on my server which returns a single number (checkmail.cgi). This number may have 2 values, 0 and 1, identifying the status of a mail box on the server:

0: no new messages
1 : new messages

On the client-side, I am using JavaScript in a HTML page.

The JavaScript should call the checkmail.cgi, and should put the return value into a variable, and should take corresponding actions.

Which JavaScript function or command or method can perform such a http call to checkmail.cgi on the server?

Any help is very much appreciated.

Peter