We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello & Thanks , I learning p5.js from https://github.com/processing/p5.js/wiki/p5.js-overview and it says that to load images , I need to install a server .
Could I instead , use a combo of css/html/js ?
THis sort of thing ?
Thanks
Answers
We don't need to setup any server in order to run JS and load files in our browsers.
We just need to make sure our browsers allow such actions. >-)
Tip: Firefox-based browsers don't need any extra config! :ar!
Thanks , Tried it in Chrome and I get : Image from origin 'file://' has been blocked from loading by Cross-Origin Resource Sharing policy: Invalid response. Origin 'null' is therefore not allowed access. ugh!
https://forum.Processing.org/two/discussions/tagged/cors
Hmm...very interesting: Thought I would give some feedback on this::
I searhed google for: "what is the most simple tiny httpserver for windows 10 "
and came up with :
http://ccm.net/faq/2568-tinyweb-server-on-windows http://www.ritlabs.com/download/tinyweb/tinyweb.zip
Ceated a Folder: c:\www ....... Unzipped tinyweb.zip in here .
Dumped p5.js/examples here : C:\www\examples
Created a one line start-TinyWeb.bat :
tiny c:\www
Created a one line index.html:
Hello, world !
Ran the .bat then clicked on http://localhost/examples/index-Test.html
TINY.EXE is only 68.kb
And lived happily ever after , or until my next 'Ask Question' .
Thanks
Glad it's worked for ya. But in my case, I just double-click my ".html" file and it simply works w/o any server. \m/
Hmm...
Maybe I should look at Firefox...
For Chrome-based browsers, another tip: :>
http://Chrome-Allow-File-Access-From-File.com/
"--allow-file-access-from-files"
Thanks
Unfortunately , the address they give:
C:\Users-your-user-name\AppData\Local\Google\Chrome\Application
Doesn't exist .
What file would I need to have access to anyways ?
vm
Right-click its shortcut. In Shortcut tab, at Target form, add
--allow-file-access-from-files
right after browser's""
path.I'm sorry , I don't know what you mean , what shortcut . It occurs to me that I am running ChromePortable . It lives here: C:\Users\me\Desktop\myPrograms\ChromePortable\GoogleChromePortable\App\Chrome-bin
Do you recommend I should do a full install / Thanks
Create a shortcut for your portable browser! L-)
Or simply install Firefox and all of those local CORS problems are gone w/o any extra configs: I-)
https://www.Mozilla.org/en-US/firefox/developer/
You can create a shortcut. If thatfile is the executable of your application, right click on it, then go to send to and then click on create shortcut on Desktop. After that go to your desktop, right click on the shortcut... and follow the instructions above. BTW, creating shortcut this way works under Windows OS. What is Chrome portable? A tablet?
Kf
https://www.portablefreeware.com/index.php?id=2074
Yep , FireFox Portable works Great !
https://www.portablefreeware.com/index.php?id=132
Thanks