// Using deployJava.runApplet to target specific element // from http://stackoverflow.com/questions/13517790/using-deployjava-runapplet-to-target-specific-element?answertab=active#answer-15139480 function writeTo(func, node) { var content = ""; var oldwrite = document.write; document.write = function(add) { content += add; }; func(); document.write = oldwrite; node.innerHTML += content; } function launchApplet() { var attributes = { code : "esieequest.Game", archive : "/game/esieequest.jar" }; var parameters = { permissions : "sandbox" }; var version = "1.7"; deployJava.runApplet(attributes, parameters, version); } function launchGame() { var wrapper = document.getElementById("play"); if (deployJava.versionCheck("1.7+")) { writeTo(launchApplet, wrapper); } else { wrapper.innerHTML = '
Java ≥7 is required to run this game.
Click here to get the latest Java Runtime Environment.