Help getting processing.js to work
am trying to get the khan academy codes to work outside of khan academy, like on my own webpage. I followed their instructions but couldn't get them to work, can someone help me? I downloaded the processing.js from their website and put it in the folder with these two things.
HELP.html
<!DOCTYPE html> <html> <head> <title>Hello Web - Processing.js Test</title> <script src="processing.js"></script> </head> <body> <h1>Processing.js Test</h1> <p>This is my first Processing.js web-based sketch:</p><canvas data-processing-sources="hello-world.pde"></canvas>
</body> </html>and helo-world.pde
void setup() {
size(200, 200);
background(100);
stroke(255);
ellipse(50, 50, 25, 25);
println("hello web!");
}
I put all three things into the same folder, yet when i open the webpage in chrome, i only get the html text, and not the processing canvas.
What am i doing wrong? I'm on a macbook air OSX yosemite. Using Sublime Text, and have tried opening in chrome and safari.
Posted Mar 18, 2015, 3:01 PM UTC
.pde is a Processing language file. Processing.js is a JavaScript library. You need a canvas and a JavaScript (.js) file, not a processing file.