SetWebURL: Difference between revisions

From Onset Developer Wiki
28days (talk | contribs)
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:
{{FuncParam|URL|The URL}}
{{FuncParam|URL|The URL}}


{{FuncReturnValue|Returns ''false''' on failure.}}
{{FuncReturnValue|Returns '''true''' on success.}}


== Example ==
== Example ==
<syntaxhighlight lang="Lua">
<syntaxhighlight lang="Lua">
SetWebURL(webId, "https://playonset.com")
-- For remote WebUIs:
SetWebURL(webId, "https://google.com")
 
-- For normal local WebUIs:
SetWebURL(webId, "http://asset/mypackage/something.html")
 
-- Since Onset 1.2.2 you can load pages from the game server. The files must be inside the public_html folder.
SetWebURL(webId, "http://server/test/something.html")
</syntaxhighlight>
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
{{Template:WebFunctions}}
{{Template:WebFunctions}}

Latest revision as of 17:30, 28 August 2020

SetWebURL

Type: Function
Context: Client
Introduced: v1.0

Description

Set the web URL. Not all URLs are whitelisted and might not work.

Syntax

SetWebURL(web, URL)

Parameters

  • web
    The web identifier
  • URL
    The URL

Return Value

  • Returns true on success.

Example

-- For remote WebUIs:
SetWebURL(webId, "https://google.com")

-- For normal local WebUIs:
SetWebURL(webId, "http://asset/mypackage/something.html")

-- Since Onset 1.2.2 you can load pages from the game server. The files must be inside the public_html folder.
SetWebURL(webId, "http://server/test/something.html")

See also