Straight Javascript has XMLHttpRequest, which performs a background, asynchronous by default HTTP request.
The documentation link points to Mozilla's, though it works the same with Safari.
var request = new XMLHttpRequest();
request.open("GET", "http://www.example.com/mypage");
request.onreadystatechange = function()
{
// "4" means "completed"
if (request.readyState != 4) return;
// do something with the response from the server
alert(request.responseText);
}
request.send();
Safari extensions can't do cross-domain requests from an injected script. For instance, if your user visits google.com, you cannot send a request to example.com from the injected script because the domains don't match. (Actually, the protocols and the ports must match, too.)
This means that you'll need your global page to perform the requests, and your injected scripts will have to do message passing to it. There's a good deal of documentation available on this on the Safari Developer Center.