Yes, it is possible to integrate js with your Processing.js code
As of version 1.9.8 Processing has a Javascript Mode, similar to the Android one present in 1.5+ , only it generates Processing.js code and writes the html/js files to disk.
This version also includes Javascript examples among others. Here's a preview of an example that parses the DOM and generates a tree:
Since at the end of the export you have a resulting Processing.js, the converted applet will run with the same speed as any Processing.js applet (slower than Java, but within decent speeds depending on the complexity of the sketch and the client's browser/machine)
The IDE now has this feature and you could make use of it. If you could run the Processing IDE with a GUI server side, that would be an option. On a recent project at work, a colleague uses a Processing applet running on a server to draw a visualization which is then loaded and integrated into a flash website:
The Processing IDE is different, but if you can run it, that's fine, otherwise, you'll need to replicate the functionality with a server side language of your choice. Thankfully, the Processing project is open source, so you can have a peek at their implementation of the JavaScriptBuild.
To try the new JavaScript mode simply download the latest build from the Processing repository.