简体   繁体   中英

Processing.js won't load script

ANSWER: *******

For everybody else that overlook things:

After you done all the other things in Getting started section:

  1. You have to cd in your processing.js directory and start the httpd.py
  2. Go to 127.0.01:9914 or any other port you specificed there.
  3. VOILA...It works.

Always read the readme :) But I also have to say that a "Get started" Section should include this important detail. Eventhough it might be obvious.


Hi I am trying to get processing.js running and it frustrates the.. out of me. It couldnt be simpler, right:

http://processingjs.org/learning

1. I have a myname.html with this:

<script src="processing-js-1.3.6/processing-1.3.6.js"></script>   
<canvas data-processing-sources="myname.pde"></canvas>

(just if you wonder, I also tried to add DOCTYPE, body, html, everything html needs, did not work)

2. And this is in my myname.pde:

void setup()  
{  
  size(200,200);  
  background(125);  
  fill(255);  
  noLoop();  
  PFont fontA = loadFont("courier");  
  textFont(fontA, 14);    
}  

void draw(){    
  text("Hello Web!",20,20);  
  println("Hello ErrorLog!");  
}  

All from the starter example (!!!). I have the whole processing.js folder in the same directory. If I load the example.html in it works.

If I hit my starter example it wont load. At this point I really dont know what I did wrong. It seems supereasy straight forward but it doesnt work.

Do I have to change something in the http conf ? Do I have to add anything in the code ? Is it the Browser ?

"I have the whole processing.js folder in the same directory. If I load the example.html in it works."

Yet, in your html in seems that you're calling the two files as if they're located in different directories:

<script src="processing-js-1.3.6/processing-1.3.6.js"></script>   
<canvas data-processing-sources="myname.pde"></canvas>

It is looking for the processing-1.3.6.js file in the processing-1.3.6.js directory and loading the myname.pde file from the current directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM