What URL is in your Browser, and What URL is your Ajax call hitting? Browsers have 'security' constraints that don't allow cross domain AJAX calls. So for instance, if I am loading a local file:
http://localhost:20080/myCustomPage.html
and within that page, I make an ajax call to
http://search.twitter.com/search?q=test
I would get a security warning from the browser. Depending on your browser this may manifest itself in a warning icon in the bottom corner (IE), or an error in the javascript log (firefox).
There is a way to get around this in ONE specific case. That case being any GET request. To do this instead of making an 'ajax' call you include a tag. That script tag will then be read and loaded. The catch here, is the call now needs to include a "callback" method, that you can implement on your side, that gets called with the result of the call.
So instead of a response like:
{
"first_name": "peter",
"last_name": "parker"
}
you would need to return
myCallBackFunction({
"first_name": "peter",
"last_name": "parker"
});
This example is using JSON, but you could easily use XML, HTML or any other result format as long as the function is called.
myCallbackFunction("INSERT RESPONSE TEXT HERE")
This method is commonly refereed to as JSONP and is fortunately implemented in the common javascript libraries like jquery from the client perspective. If you control the server side, you will need to hard code a callBackFunction wrapper, or expose a parameter that allows the client to set it. And unfortunately if you don't own the library there isn't much you can do unless the owner of the service already provides that feature. Fortunately most Web 2.0 services you would be doing stuff like this, already implement that feature.