We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm having trouble loading a local file or local image into p5.js.
Keep getting the error: MLHttpRequest cannot load file:///Users/mac/Desktop/p5/empty-example/assets/test.txt.
Some browsers have limitations on loading files / running JS using the file:// protocol.
You should start up a simple web server, like Mongoose, and run your code from http://localhost
Or just use Firefox Development Edition:
No need for any server this way! \m/
perfect! works now! thanks.
can you update the local json file in p5js. I mean, can we update the local data.json file with new json object,
For example let say I have -
"text":"New processing is avaialbe to download"
"text":"I am the new processing"
"text":"Now I am updated. Restart me"
// New json object ---> how to update this in the file
"text":"I am the new JSONOBject hwo do I update my self"
A browser can read a file from the file system, but it won't write it back!
Or you need a server-side code (PHP or other) to get the update request and modify the file accordingly.