I\'ve been smashing my head against a brick wall with this one, i\'ve tried loads of the solutions on stackoverflow but can\'t find one that works!
Basically when I
try to send content type header from server use this just before echoing
header('Content-Type: application/json');