- Documentation
- Client functions
- loadBrowserURL
Function
loadBrowserURL
Loads an address in the browser. A local browser opens resource files, a remote one opens pages from allowed domains.
Syntax
bool loadBrowserURL(browser webBrowser, string url [, string postData = "", bool urlEncoded = true])Arguments
webBrowserbrowser- The browser.
urlstring- The address:
http://trilogy/local/file.html,http://trilogy/<resource>/fileorhttps://.... postDatastring, optional = ""- Data sent with POST.
urlEncodedbool, optional = true- Whether
postDatais form-encoded.
Returns
true if the address was accepted.
Example
addEventHandler("onClientBrowserCreated", browser, function()
loadBrowserURL(source, "http://trilogy/local/html/hud.html")
end)
Notes
The page only sees <file> entries. The resource's script files are not available to the page.
See also
createBrowserCreates a browser: an HTML page rendered into a texture. Draw it withdxDrawImageand load the address only in theonClientBrowserCreatedevent.onClientBrowserCreatedThe browser is ready (the page process started) and you can load an address in it.onClientBrowserDocumentReadyThe page in the browser has loaded. A good place forexecuteBrowserJavascript.