Christiaan Quyn14,706 Points
'Unresolved variable inoffice' when running on localhost
Hey guys , so my code works fine on workspace , it's exactly the same as the video but the moment I load it up on my IDE -JetBrains Webstorm running locally, it just loads the h2 headings and nothing underneath. It seems like my widget.js file isn't recognizing the variables defined in the arrays of the .json files. Does anyone know what I have to do ? How do I make my conditional 'if' statement compare against the value defined in the objects of the .json file ?
Seth Kroger56,365 Points
Are you previewing the page through WebStorm's built-in web server or as a file: (as opposed to http:) in your browser. If it's the latter you can't make an XHR on a file, and the JSON won't load.
Without looking at your code it would be hard to pinpoint where the issue is. If you open the developer console on chrome or firefox do you get any status code errors?
I do not see errors in your ajax request. Do you have both JSON files stored inside a data folder?