Ken Webb 2011-01-21T23:08:13Z
BrowserJS is a "JSR-223 script engine for the native JavaScript engine embedded in web browsers". Xholon already makes available several other JSR-223 script engines, including the Rhino JavaScript engine which is used to script a Java application rather than a web browser.
While a Xholon application (such as the Bestiary applet) is running inside a web page, you can paste in a script. This has been tested with Firefox, but it does not yet work correctly with Internet Explorer.
Here are a few sample BrowserJS scripts, ready to be copied and pasted into the Bestiary or other app. Just select the text of one of the scripts on this page, copy it to the clipboard, paste the text into the console panel on the Bestiary page, and press the Submit button. The applet needs to be actively running (unpaused) for this to work correctly.
<script implName="lang:BrowserJS:inline:"><![CDATA[ alert('Hola Mundo'); ]]></script>
<script implName="lang:BrowserJS:inline:"><![CDATA[ var d = new Date(); alert(d); ]]></script>
<script implName="lang:BrowserJS:inline:"><![CDATA[ var x = document.getElementById("licoriceButton"); x.disabled=false; // or true ]]></script>
<script implName="lang:BrowserJS:inline:"><![CDATA[ var x = document.getElementById("divOne"); x.innerHTML = "<p>uno dos tres cuatro cinco seis siete ocho nueve diez</p>"; ]]></script>