Webview:onLoaded(success, httpstatus) event
This event is fired when the Webview widget has just finished to load the current web page.
It provides two parameters :
- success : a boolean value indicating if page loading was successful.
- httpstatus : an integer indicating the HTTP status code.
Return value
The event returns no value.Example
local ui = require "ui"
require "webview"
-- creates a simple window
local win = ui.Window("Webview:onLoaded() event sample", 320, 200)
local Webview = ui.Webview(win, { url = "https://www.luart.org" }, 150, 70)
-- Use the Webview:onLoaded() event to set the window title
function wv:onLoaded(success, status)
win.title = wv.title
end
win:show()
-- update the ui
while win.visible do
ui.update()
end