It is very easy to load an external sketch with Processing.js. How easy?
Two lines easy!
<script src="processing.min.js"></script> <canvas datasrc="init-example.pjs" width="200" height="200"></canvas>
1) Include the “processing.js” JavaScript file.
2) Use the datasrc attribute to specify which Processing sketch you want to load.
This way the sketch is loaded using AJAX, so for security reasons you cannot run cross domain scripts.