Embedding a Processing.js sketch in a WordPress page

Processing.js is very handy, and it is very cool to run your sketches in your browser. I was looking around for one easy way to embed a sketch into a WordPress page or post, and found a good option.

I used the Processing JS plugin, written by Keyvan Minoukadeh. You can get it from this location : http://www.keyvan.net/code/processing-js/

I just faced a small issue while trying to use this plugin and the preview mode in WordPress. Sketch was not running, but reloading the page is solving the issue. And there is no problem if the post is really published, only issue is in preview mode. I am using Chrome on MacOS.

Below one example I made in few code lines :

Tags: ,

Embedding a Processing.js sketch in a WordPress page

One Response

  1. Hi Gael, glad you found it useful. And thanks for the report about preview mode not displaying your sketch. I’ve noticed this too. I think the reason is due to a security feature built into Chrome. See http://stackoverflow.com/questions/1547884/refused-to-execute-a-javascript-script-source-code-of-script-found-within-reque

    I’ll have to see what I can do to prevent this. As you say, reloading the page after hitting preview should work.

    Keyvan April 15, 2013 at 7:17 am #