{"name":"htmlLoad","operator":null,"title":"htmlLoad","type":"command","url":"https://community.bistudio.com/wiki/htmlLoad","revid":369066,"updated":"2024-09-02T20:24:56Z","groups":["GUI Control"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Load HTML from file or URI using given control. File path is relative to current mission dir or an absolute path (with drive letter etc.).\nThe command is subject to restrictions, imposed by CfgCommands class.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v2.10 the 'title' attribute is supported within <img> and <a> html tags\n\n> [!IMPORTANT]\n> For unknown reasons, URL's length is limited to 255 characters.","syntaxes":[{"syntax":"control htmlLoad filename","since":null,"effect":null,"exec":null,"params":[{"name":"control","type":"Control","optional":false,"default":null,"description":null,"types":["Control"],"since":null,"text":"control: Control"},{"name":"filename","type":"String","optional":false,"default":null,"description":"local file name or remote file URL","types":["String"],"since":null,"text":"filename: String - local file name or remote file URL"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"control","types":["Control"]},"right":{"text":"filename","types":["String"]}}],"examples":[{"text":"```sqf\n_control htmlLoad \"briefing.html\";\n```","code":["_control htmlLoad \"briefing.html\";"]},{"text":"```sqf\n_control htmlLoad \"http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English\";\n```","code":["_control htmlLoad \"http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English\";"]},{"text":"Display news item:\n\n```sqf\n0 spawn {\n    disableSerialization;\n    private _html = findDisplay 46 createDisplay \"RscCredits\" ctrlCreate [\"RscHTML\", -1];\n    _html ctrlSetBackgroundColor [0,0,0,0.8];\n    _html ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];\n    _html ctrlCommit 0;\n    _html htmlLoad \"http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English\";\n};\n```","code":["0 spawn {\n\tdisableSerialization;\n\tprivate _html = findDisplay 46 createDisplay \"RscCredits\" ctrlCreate [\"RscHTML\", -1];\n\t_html ctrlSetBackgroundColor [0,0,0,0.8];\n\t_html ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];\n\t_html ctrlCommit 0;\n\t_html htmlLoad \"http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English\";\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["ctrlHTMLLoaded","loadFile","preprocessFile","preprocessFileLineNumbers","HTML File Format"],"notes":[{"user":"BrotherhoodOfHam","date":"2014-09-07T18:02:00Z","text":"htmlLoad works with URLs as well as html files."},{"user":"Killzone_Kid","date":"2014-09-07T19:35:00Z","text":"While htmlLoad surprisingly does work with URLs as pointed above, the operation is blocking, meaning the whole game will freeze until the operation is complete.\nIt is therefore not recommended to use this command in such way."},{"user":"Benargee","date":"2015-04-21T18:08:00Z","text":"Example use of URL can be found in BIS_fnc_GUInewsfeed with the function browser."},{"user":"Tupolov","date":"2015-10-07T22:03:00Z","text":"(Arma 3) In order to use URLs, they must be included in CfgCommands -> allowedHTMLLoadURIs. In order to use URIs with params a wildcard * character is supported:\n**Script**\n\n```sqf\n_newsOnline = \"http://alivemod.com/alive_news.php?map=\" + _map + \"&mission=\" + _mission + \"&player=\" + _player;\n_ctrlHTML htmlLoad _newsOnline;\n```\n\n**Config**\n\n```cpp\nclass CfgCommands {\n    allowedHTMLLoadURIs[] += {\n        \"http://alivemod.com/alive_news.php*\"\n    };\n};\n```"}],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}