We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, guys, I want to put some exercises in different sketch.js
files in one html page, I just want to share my learning on my blog:).
One is just simple,
<script src="p5.min.js"></script>
<script src="sketch01.js"></script>
Now, if I just add
<script src="sketch02.js"></script>
after the first statement, It won't show the second one. How to do that? By DIV? Or ...
Thanks in advance.
Comments
Wow, thanks!
@GoToLoop
How to do if I want to put the
function s
into extern js file? Sorry for my poor js. I am learning it.I'm also trying to learn web programming too!
AFAIK, every ".js" needs to be declared inside the ".html" file.
Sorry dunno much about it yet! X_X
@GoToLoop
in the external
sketchTest.js
file,we can do it like this:Then in the
index.html
,Cheers!
for a fast and easy solution, you can also make different pages for each sketch, then put them all together using iframes: https://github.com/lmccart/p5.js/wiki/Embedding-p5.js#using-iframes
@lmccart It's a nice solution!