lol. It's such a shame Javascript doesn't have sockets. I understand why it doesn't - but it is still a great language nonetheless.
Hehe, tricky question. While Javascript is client base, it will have security issues like this - the cross site requests are forbidden. But if an AJAX request is calling PHP script, it can be done easily. But there are solutions with jQuery with the $.getJson method. This is example for accessing Flickr API: $.getJSON('http://api.flickr.com/services/rest/?&method=flickr.photosets.getPhotos&api_key=' + apiKey + '&photoset_id=72157619415192530&format=json&jsoncallback=?', function (data){ /* process json data here */ }) Code (markup): where apiKey variable is the API key from flickr.