<p>Say I have a web service <a href="http://www.example.com/webservice.pl?q=google" rel="noreferrer">http://www.example.com/webservice.pl?q=google</a> which returns text "google.com". I need to call this web service (<a href="http://www.example.com/webservice.pl" rel="noreferrer">http://www.example.com/webservice.pl</a>) from a JavaScript module with a parameter (q=google) and then use the return value ("google.com") to do further processing.</p>

<p>What's the simplest way to do this? I am a total JavaScript newbie, so any help is much appreciated.</p>

Take a look at one of the many javascript libraries out there. I'd recommend
jQuery
, personally. Aside from all the fancy UI stuff they can do, it has really good
cross-browser AJAX libraries
.
```
```
$.get(
    "http://xyz.com/webservice.pl",
    { q : "google" },
    function(data) {
        alert(data);  // "google.com"
    }
);
```
```