Hello guys,
I need to access some json models in my XBlock javascript file, using the path of this files. I stored the json file in the public directory, as suggested by the local_resource_url() method in the XBlock API.
In the student_view method I add the files as,
model = self.runtime.local_resource_url(self, “public/model.json”)
(…)
Then in the js file I use something like: load("/public/model.json")
I need to get a path to this files to be able to load them in the javascript code. Now I get a 404 error as the request is done to “localhost/public/model.json” and that doesen’t exist.
Can someone help me solve this problem?
Thanks a lot
J