Do not all servers permit Processing.js or what is wrong?

22 views
Skip to first unread message

Ryan Scott

unread,
Mar 10, 2012, 8:21:20 AM3/10/12
to Processing.js
http://endersdrift.freeiz.com/processing/experiment1.html

I tried extending the source for the .js file just to be safe and
before doing in-line I had tried using a .pde that I wrote.

Is it something I'm doing wrong or does it mean my free webhost
doesn't support either processing.js or canvas?

Benj. N. Sugar

unread,
Mar 10, 2012, 8:14:22 PM3/10/12
to Processing.js
are borrowing from the example located here under "It is possible to
put Processing code directly in your web page":

http://processingjs.org/articles/p5QuickStart.html

if you are, that's a slightly tricky example since it doesn't give you
any reference with regard to what goes in the <head> and what goes in
the <body> (though it might be implied that its all in the <body>
since the <canvas> won't be in the <head>.

instead, try pomax's example located here under "Putting your sketch
in line on a page":

http://processingjs.org/articles/PomaxGuide.html

as pomax notes, this is not the "preferred" way of using
processing.js; you can see his explanation for why below the example.

as i understand servers and clients your server is agnostic when it
comes to supporting canvas or processing. its just a place to get the
files from, it doesn't do any of the computation (in this use case).
it is possible that your browser doesn't support canvas but i doubt
that is the problem in this case since your sketch doesn't work in my
browser and my browser does support canvas. unless its internet
explorer which i think was late to the game on supporting canvas. one
thing to be aware of with free server space (or any space for that
matter) is that where ever you put the files in needs to have
permissions such that the browser can access the file. this does not
appear to be a problem in your sketch because i was able to see that
it downloaded the processing.js file using firebug and your processing
code is inline.

Erich Buri

unread,
Mar 11, 2012, 2:59:43 PM3/11/12
to proces...@googlegroups.com
Hi,

your html-document is simply incomplete, the browser needs a little bit more to know what you want him to do.

Try this:
<DOCTYPE html>
<html>
<head>

<script src="http://endersdrift.freeiz.com/processing/processing-1.3.6.min.js"></script>
<script type="text/processing" target="processing-canvas">
void setup() {
   size(200, 200);
   background(100);
   stroke(255);
 ellipse(50, 50, 25, 25);
 println('hello web!');
 }
</script>

</head>
<body>

<canvas id="processing-canvas"> </canvas>

</body>
</html>

I know that Processing is intended to hide the technical details to the creative programmer and I think this is a good thing.
ProcessingJS is a great thing as it brings this to the web, but there is a bit of web-designer know-how that you need to know in order to get started.

Best regards,
Erich




--
You received this message because you are subscribed to the Google Groups "Processing.js" group.
To post to this group, send email to proces...@googlegroups.com.
To unsubscribe from this group, send email to processingjs...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/processingjs?hl=en.


Ryan Scott

unread,
Mar 12, 2012, 6:40:09 AM3/12/12
to Processing.js
Ah okay I had done it originally with the scripts in the header and
the canvas in the body and it didn't work. I see now why in the "For
the impatient" section http://processingjs.org/articles/p5QuickStart.html#quickstart
it doesn't have the script for including the .pde and I did the
include but didn't know to change the target to point it at my canvas.

It's working now and I was able to test my own script and that also
works.

Thanks everyone!
Reply all
Reply to author
Forward
0 new messages