I am trying to load a JSON file into my VF app via AJAX. It currently sits in a zipped static resource, like such:
myResources
|
|js
|
|target.json
|scripts.js
I am able to call scripts.json by using the following:
I am trying an ajax call like this (from the vf page):
var sfJSON;
var jsonURL = "{!URLFOR($Resource.myResources, 'myResources/js/target.json')}";
$j.getJSON(jsonURL, function(data){
sfJSON = data;
});
However this isn't working. No error is occurring - jQuery mentions that this will fail silently.
When I look at the source in chrome inspector, I see that the VF page has correctly changed the URL to
"/resource/000000/myResource/myResource/js/target.json"
(the double myResource is accurate).
When I try just navigating to that url, I do get the json file. But for some reason, it isn't loading via the AJAX call.
What am I missing?
Thank you!
000000
in the path?