We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Does anybody know an easy way to convert selectInput() to javascript? It isn't supported by processingjs and I am trying to host a .pde file on a website. Would I just use FileReader() to get the location of the file and pass it to the appropriate method? I am relatively new to web development so any advice would be helpful :D Thanks!
Answers
In general, JavaScript is just not able to read a file from the user's hard disk, for security reasons.
Too JS noob here to know that answer. AFAIK, web programing languages doesn't have such "power" by itself. It should request a local server for such resources! 8-X
working on this right now: https://github.com/lmccart/p5.js/issues/370
for now, maybe some of the hackarounds here could help? https://github.com/shiffman/Programming-from-A-to-Z-F14/tree/master/week1/05_fileinput_p5
Looks like HTML5 is relaxing the rule I refer to. I suppose it can be OK when the file selection comes directly from the user (still cannot read an arbitrary file from a path).