I’m trying to locate my files in a correct directory since I’m keeping getting unknown resource issue.
Here is how my current ‘html’ folder looks like.
html
- experiment.js
- index.html
- resources folder
- data folder, where csv files are located
- image folder, where jpg used in the experiment is located.
Here is the error message:
Currently, I’m getting unknown resource issue for image.
Unfortunately we encountered the following error:
when setting the image of ImageStim: trial_image
when getting the value of resource: ./image/A.jpg
unknown resource
Try to run the experiment again. If the error persists, contact the experiment designer.
Can anyone tell me whether I located my files in an inappropriate folder?
Does the files need to be changed to the following directory format?
html
- experiment.js
- index.html
- data folder, where csv files are located
- resources folder
- image folder, where jpg used in the experiment is located.
For those who are looking for the answer to similar to my problem. Here is what I figured out:
I figured that every csv files, images, etc needs to be under ‘html/resources’ folder.
for file path, do not use ‘./’ in the front.
ex. your image is located under ‘html/resources/image/A.jpg’
Then, your file path needs to be ‘image/A.jpg’, not ‘./image/A.jpg’ ‘resources/image/A.jpg’, nor ‘./resources/image/A.jpg’
So I was using a backslash “”, not a forward slash “/”. Backslash was bein detected fine by python and Matlab but not by javaScript.
I corrected that as per suggestion here, and now it is working