htmlLoad: Difference between revisions
Jump to navigation
Jump to search
m (add uri and link to HTML_file page) |
Killzone Kid (talk | contribs) (255 limit on URL length) |
||
Line 7: | Line 7: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Load [[HTML-Files]] from file or Uri using given control. | | Load [[HTML-Files]] from file or Uri using given control. File path is relative to current mission dir or an absolute path (with drive letter etc.). The command is subject to restrictions, imposed by [[CfgCommands]] class. <br><br>{{Warning | For same strange reason the length of URL that could be passed to the command is limited to 255 characters.}}|= Description | ||
File path is relative to current mission dir or an absolute path (with drive letter etc.). | |||
The command is subject to restrictions, imposed by [[CfgCommands]] class. |= Description | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 20: | Line 14: | ||
|p1= control: [[Control]] |= Parameter 1 | |p1= control: [[Control]] |= Parameter 1 | ||
|p2= filename: [[String]] |= Parameter 2 | |p2= filename: [[String]] - local file name or remote file URL |= Parameter 2 | ||
| [[Nothing]] |= Return value | | [[Nothing]] |= Return value |
Revision as of 14:50, 20 January 2019
Description
- Description:
- Load HTML-Files from file or Uri using given control. File path is relative to current mission dir or an absolute path (with drive letter etc.). The command is subject to restrictions, imposed by CfgCommands class.
- Groups:
- Uncategorised
Syntax
- Syntax:
- control htmlLoad filename
- Parameters:
- control: Control
- filename: String - local file name or remote file URL
- Return Value:
- Nothing
Examples
- Example 1:
_control htmlLoad "briefing.html";
- Example 2:
_control htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English";//[1]
- Example 3:
- Display news item:
0 = 0 spawn { disableSerialization; _html = findDisplay 46 createDisplay "RscCredits" ctrlCreate ["RscHTML", -1]; _html ctrlSetBackgroundColor [0,0,0,0.8]; _html ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH]; _html ctrlCommit 0; _html htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English"; };
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
Bottom Section
- Posted on September 7, 2014 - 18:02 (UTC)
- BrotherhoodOfHam
-
htmlLoad works with URL's as well as html files.
- Posted on September 7, 2014 - 19:35 (UTC)
- Killzone Kid
- While surprisingly htmlLoad does work with URLs as pointed above, the operation is blocking, meaning the whole game will freeze until the operation is complete. Therefore it is not recommended to use this command in such way.
- Posted on April 21, 2015 - 18:08 (UTC)
- Benargee
- Example use of URL can be found in BIS_fnc_GUInewsfeed with the function browser.
- Posted on October 7, 2015 - 22:03 (UTC)
- Tupolov
-
(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
Script Example:_newsOnline = "http://alivemod.com/alive_news.php?map=" + _map + "&mission=" + _mission + "&player=" + _player; _ctrlHTML htmlLoad _newsOnline;
Config Example:
class CfgCommands { allowedHTMLLoadURIs[] += { "http://alivemod.com/alive_news.php*" }; };