I’ve used things such as VScode, brackets and notepad in the past to create web pages.
However I cant seem to get it to work with P5.js.
I opened up a new sketch and saved the files in notepad, but upon opening the sketch it gets stuck on loading.
I’ve done this with other projects with more HTML, however the CSS is not applied and anything bellow the sketch doesn’t get shown.
These use the same code:
LEFT: was opened via File > Share and coping and pasting the link.
RIGHT: was opened via double clicking a copy of the HTML file. (with the CSS and JS files in the same folder but saved separately)
That suggests not double clicking the file to open in the browser
Should I be learning how to create a local host?
I have VScode on my device, but don’t know anything about hosting
For what it’s worth, this works fine for me in Firefox, but not in Chrome.
I think the problem is because you’re loading a local file:// URL, and then p5.js is loading a blob resources. Apparently Chrome doesn’t like that for some reason. I tracked this down to this bug:
Turns out this is caused by something in the p5.sound library, which you’re including in your index.html file. If you aren’t using that library, you should be able to remove the line that loads the library:
If you need the sound library, the more involved fix for this is running a local server instead of loading your files directly. But my guess is that removing the sound library will solve your problem for now.