The question raised in 2014 and it's 2019 so I guess it's good to look for better option.
You can simply use fetch
api in Javascript which provide you more flexibility.
for example, see this code
fetch('./api/some.json')
.then((response) => {
response.json().then((data) => {
...
});
})
.catch((err) => { ... });