Hi guys, I need help to open p5.js file.
I downloaded p5.js for window version.
When I finish my work and try to open the saved file, I can't open it with an error message.
It says,
Error: ',' is required.
Code: 800A03EC
Source: Microsoft JScript compilation error
What should I do to fix this problem?
I need your help!
Thanks!
Looking at the screenshot, the file is compiled by jscript, which is a very old version of javascript (p5.js is based on this). Try opening the file in the latest version of chrome, firefox, or MS edge.
you are getting this error because you have double-clicked on the sketch.js file in explorer and it's trying to run it with the desktop javascript interpreter. in order to see your sketch, you'll need to view the index.html file in your browser. for simple cases you can just double-click on the index.html file and it will open in your default browser, but you're going to want to eventually switch to using a development web-server if you want to access resources on other web sites.
you are getting this error because you have double-clicked on the
sketch.jsfile in explorer and it's trying to run it with the desktop javascript interpreter. in order to see your sketch, you'll need to view theindex.htmlfile in your browser. for simple cases you can just double-click on theindex.htmlfile and it will open in your default browser, but you're going to want to eventually switch to using a development web-server if you want to access resources on other web sites.
- you should disable "Hide extensions for known file types" in explorer, so you can see what the files are.
- here's some simple startup instructions: https://p5js.org/get-started/
- you might want to use the p5 web editor: https://editor.p5js.org/
Thanks for your reply @Spongman
But what if i want to open Java script file and change some code which I have done?
You need an editor for that. The most basic editor available in Windows is Notepad, you need to open the file in it. Some other popular editors are Brackets, Sublime text, Atom, VSCode, Notepad++, etc.
You need an editor for that. The most basic editor available in Windows is Notepad, you need to open the file in it. Some other popular editors are Brackets, Sublime text, Atom, VSCode, Notepad++, etc.
I solved it. Thank you so much guys!
Most helpful comment
you are getting this error because you have double-clicked on the
sketch.jsfile in explorer and it's trying to run it with the desktop javascript interpreter. in order to see your sketch, you'll need to view theindex.htmlfile in your browser. for simple cases you can just double-click on theindex.htmlfile and it will open in your default browser, but you're going to want to eventually switch to using a development web-server if you want to access resources on other web sites.