Listing 1. JavaScript, Python and Ruby, All in One HTML File

<html>
<head>
<script type="text/javascript">
function helloJS() {
    window.document.getElementById('output').innerHTML
                       = "Hello from Titanium using Javascript";
}
</script>

<script type="text/python">
def helloPython():
    window.document.getElementById('output').innerHTML \
                         = "Hello from Titanium using Python"

window.helloPython = helloPython
</script>

<script type="text/ruby">
def helloRuby
    window.document.getElementById('output').innerHTML \
                         = "Hello from Titanium using Ruby"
end

window.helloRuby = helloRuby
</script>

</head>
<body>
<div id="output">
</div>
<div>
<button onclick="helloJS()">helloJS</button>
<button onclick="helloPython()">helloPython</button>
<button onclick="helloRuby()">helloRuby</button>
</div>
</body>
</html>

