I created a .jar java applet with Processing. I want to be able to dynamically embed the the applet onto my page, but what I’m doing is currently replacing my entire current page with the java applet, rather than appending it in a predefined DOM container. Here’s my code:
var $projContainer = $('#project_container');
var attributes = {
codebase:'http://java.sun.com/update/1.6.0/jinstall-6u20-windows-i586.cab',
code:'tree',
archive: projFile,
width: '680',
height: '360'
};
var parameters = {archive: projFile, code: 'tree', scriptable: 'true', image: '/images/structure/processing_loading.gid', boxMessage: 'Loading...', boxbgcolor: '#FFFFFF'};
var version = '1.5' ; // JDK version
deployJava.runApplet(attributes, parameters, version); //Want to be able to specify a dom element to deploy to here
I ended up porting to processing.js for this, which has no problems with being loaded via AJAX.
I put a tutorial for that process up here, since people were contacting me about it:
http://mikeheavers.com/index.php/site/code_single/load_processing.js_sketch_with_ajax_on_user_click