Hi,
I'm using the function $.ajax(...) to get information from the server. I'm using JQuery 1.4.1 version.
However this works ok in the IE but not in the Firefox nor Chrome.
In the server side I'm returning
response.setContentType("application/json;charset=UTF-8");
out.write("{\"XXX\": \"1\",\"YYY\": \"2\"}");
The client looks like this
$("input.buttonGetAjaxRestfull").click(function () {
$.ajax({
url: "http://localhost:8080/RestFullServiceProject/resources/employeess/1002/",
type: 'GET',
dataType : 'json',
data: data,
success: function(data) {
alert('ajax Data->'+data.email);
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
alert("XMLHttpRequest:"+XMLHttpRequest+" textStatus:"+textStatus+"errorThrown:"+errorThrown);
},
beforeSend: function(XMLHttpRequest)
{
alert("XMLHttpRequest:"+XMLHttpRequest);
}
});
});
Do you have any idea what could be the problem? Does the server need special config (content type, headers or others) to this to work?
Thanks in advance