self:emit
Client
Posts a message from Lua to the webview's JavaScript context
Syntax
local status = self:emit(
input
)Parameters
| Type | Name | Description |
|---|---|---|
string | input | Message string to post to the webview |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, or false on failure |
Examples
local wv = webview.create()
-- Send a JSON payload to the webview
wv:emit('{"event":"ready","data":{"user":"aviril"}}')