When I retrieve data from my localhost as JSON everything is OK. When I try to get that JSON data from a remote machine everything is OK too. I can parse that JSON data comes from my localhost into objects( a datagrid plugin: jqgrid renders it). However when I try to use remote source it doesn't. At firebug it says 200 OK but it shows an error icon and writes it red. I checked the differences between my localhost and remote connection headers and I found that there is not that header at remote connection:
X-Requested-With XMLHttpRequest
I think problem may be that. I wasn't setting it and it was working well. It occurs at remote request.
Any ideas to solve it?
PS: I tried setting Ajax headers but didn't work:
$.ajaxSetup({
headers: {"X-Requested-With":"XMLHttpRequest"}
});
$("#userTable").jqGrid({
url:'http://xx.xx.x.xxx:8080/aa/bb/cc/user',
colNames:['User Name','Password'],
colModel:[
{name:'userName',index:'userName', width:100},
{name:'password',index:'password', width:55}
],
jsonReader: ...
...
});
When I use that setup I can not even see the GET Request from Firebug.
PS: I use Spring 3 with REST and Tomcat as web server.