self:load_url
Client
Loads a URL in the webview
Syntax
local status = self:load_url(
url
)Pass a resource-scoped path instead of a URL to load a file straight out of a resource.
http:///https://— passed straight through and loaded as-is.- Local path — anything else resolves relative to the current resource's directory and is served over the client's local HTTP server.
- Cross-resource path — prefix with
:resourcenameto resolve relative to another running resource's directory. - Example —
:resource_a/web/index.htmlloadsweb/index.htmlfrom insideresource_a.
Parameters
| Type | Name | Description |
|---|---|---|
string | url | A full http(s):// url, or a resource-scoped file path to load |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.webview.create()
entity:load_url("https://google.com")local entity = core.webview.create()
entity:load_url("web/index.html")local entity = core.webview.create()
entity:load_url(":resource_a/web/index.html")