1:<htmli> 2: <head> 3: <script language="JavaScript"> 4:// Init main window 5:Sash.WindowApp.MainWindow.TitleText = "Hello World"; 6:Sash.WindowApp.MainWindow.Visible = true; 7: 8:// Show OS version on status bar. 9:Sash.WindowApp.MainWindow.StatusVisible = true; 10:Sash.WindowApp.MainWindow.StatusText = 11: "Running on " + Sash.Core.Platform.OS; 12: 13:// Action triggered by the click of a button. 14:function showGreeting(str) { // Arg unused 15: // Get the text box object 16: var box = document.getElementById("box"); 17: var name = "world"; // Default value of greetee 18: if (box.value != "") { 19: name = box.value; 20: } 21: var message = "Hello, " + name; 22: var title = "Greetings!"; 23: // Pops up message box with OK button 24: Sash.Core.UI.MessageBox(message, title, 25: Sash.Core.UI.MB_OK); 26:} 27: </script> 28: </head> 29: 30:<body> 31:<!-- Actual HTML form shown by browser --> 32:<P>Enter a name:<br> 33:<input size=30 id="box"> 34:<!-- When clicked, the OK button invokes the onclick method --> 35:<input type="submit" value="OK" onclick="showGreeting()"> 36:</body> 37:</html>