I'm having some problems understanding JS Callbacks in regards to getting and parsing JSON information.
What I'm trying to do is using this remote code to populate a select dropdown.
setCategories({
"categories": ["Billing", "Gameplay", "Bugs", "Rules & Policies", "Technical Support"]
});
This code here above is coming from a remote .js file, this is the whole content of the file. I can't link to the file at this point.
Now I'm using what I know to access the JSON information
$.ajax({
url: "http://web.ccpgamescdn.com/common/frontendtest/categories.js",
dataType: 'jsonp',
data: data,
success: function(data, textStatus, jqxhr) {
console.log(data); //data returned
}
});
How ever this returns me this error message from the console
Uncaught ReferenceError: setCategories is not defined
I know how to parse a simple json file, but this JS Callback is beyond my knowledge and I'm not sure how to work with this.