Agent67
Honorary Master
So I need to access and get the contents of a local JSON file that contains the names of each staff member, their job title and an image of their face, so I can use JS to load all of that onto the related page. The problem is I tried to use fetch at first but it blocked me because of CORS.
I can't make a server, because if I do then it'll complicate things when I send in my assignment (yes, the same one mentioned in this post) and because the lecturer told me to stick close to the file submission requirements.
I can't put the JSON file contents into my script either because there has to be a separate "staff.json" file according to the requirements.
So I'm not sure what to do anymore. What do I do just to access the damned JSON file in my script?
P.S I already validated my JSON file on JSONLint, and I got a clean bill of health.
I can't make a server, because if I do then it'll complicate things when I send in my assignment (yes, the same one mentioned in this post) and because the lecturer told me to stick close to the file submission requirements.
I can't put the JSON file contents into my script either because there has to be a separate "staff.json" file according to the requirements.
So I'm not sure what to do anymore. What do I do just to access the damned JSON file in my script?
P.S I already validated my JSON file on JSONLint, and I got a clean bill of health.



