Garry's Mod Wiki

Panel:OpenURL

Panel:OpenURL

  Panel:OpenURL( string URL )

Description

Instructs a HTML control to download and parse a HTML script using the passed URL.

This function can also be used on HTML.

Arguments

1 string URL
URL to open. It has to start or be one of the following:

  • http://
  • https://
  • asset://
  • about:blank
  • chrome://credits/

Example

Displays the Garry's Mod wiki page.

local frame = vgui.Create( "DFrame" ) frame:SetTitle( "HTML Example" ) frame:SetSize( ScrW() * 0.75, ScrH() * 0.75 ) frame:Center() frame:MakePopup() local html = vgui.Create( "DHTML", frame ) html:Dock( FILL ) html:OpenURL( "wiki.facepunch.com/gmod" )

Example

Displays the default loading screen from the HTML folder.

local frame = vgui.Create( "DFrame" ) frame:SetTitle( "HTML Example" ) frame:SetSize( ScrW() * 0.75, ScrH() * 0.75 ) frame:Center() frame:MakePopup() local html = vgui.Create( "HTML", frame ) html:Dock( FILL ) html:OpenURL( "asset://garrysmod/html/loading.html" )
Output:

Special Pages


Wikis

?

Render Time: 56ms

DB GetPage 38
Generate Html 3
SaveChanges (1) 6
Render Body 0
Render Sidebar 7