You can find more samples in the Sciter SDK (http://sciter.com)
Table of Contents
Basic DOM manipulations
Event handling using IElementEvents interface
Event handling using IElement.Subscribe* functions
input|text:
input|checkbox:
textarea:
button
Type something here:
Creating and manipulating XML document using MSXML
const doc = document.createHTMLDocument();
const body = doc.body;
for (var i = 0; i < 10; i++)
{
const heading = body.appendChild(doc.createElement("h"));
const textNode = heading.appendChild(doc.createTextNode("Heading " + i));
}
$("#oleOut1").innerText = body.innerHTML;
Invoke externally passed TSciterObject object
// JS code:
$('#cmdTestSayHello').on("click", function(evt, target)
{
var x = WaptSOM.say_hello('toto');
});
Intercept non-existing view methods calls
// The Foo function does not exist in the view context, but you
// can intercept and handle that function call
procedure TMainForm.Sciter1MethodCall(ASender: TObject; const MethodName:
WideString; const Args: array of OLEVariant; var ReturnValue: OleVariant;
var Handled: Boolean);
begin
if MethodName = 'Foo' then
begin
ShowMessage('Method ' + MethodName + ' is calling with argument ' + Args[0]);
Handled := True;
end;
// else Handled = False and Sciter will emit a warning message
end;