htmlLoad: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Category:Scripting Commands ArmA2" to "Category:Scripting Commands Arma 2")
m (Fix link)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| 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 some strange reason the length of URL that could be passed to the command is limited to 255 characters.}}|DESCRIPTION=
| Load [[HTML File Format|HTML]] 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.
{{Warning | For unknown reasons, URL's length is limited to 255 characters.}} |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| control '''htmlLoad''' filename |SYNTAX=
| control [[htmlLoad]] filename |SYNTAX=


|p1= control: [[Control]] |PARAMETER1=
|p1= control: [[Control]] |PARAMETER1=
Line 20: Line 21:


|x1= <code>_control [[htmlLoad]] "briefing.html";</code> |EXAMPLE1=
|x1= <code>_control [[htmlLoad]] "briefing.html";</code> |EXAMPLE1=
|x2= <code>_control [[htmlLoad]] "<nowiki>http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English</nowiki>";//[http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English]</code> |EXAMPLE2=
 
|x3= Display news item:<code>0 = 0 [[spawn]] {
|x2= <code>_control [[htmlLoad]] "<nowiki>http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English</nowiki>"; {{cc|[http://www.bistudio.com/newsfeed/arma3_news.php?build{{=}}main&language{{=}}English link]}}</code> |EXAMPLE2=
 
|x3= Display news item:<code>[] [[spawn]] {
[[disableSerialization]];
[[disableSerialization]];
_html = [[findDisplay]] 46 [[createDisplay]] "RscCredits" [[ctrlCreate]] ["RscHTML", -1];
_html = [[findDisplay]] 46 [[createDisplay]] "RscCredits" [[ctrlCreate]] ["RscHTML", -1];
Line 28: Line 31:
_html [[ctrlCommit]] 0;
_html [[ctrlCommit]] 0;
_html [[htmlLoad]] <nowiki>"http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English"</nowiki>;
_html [[htmlLoad]] <nowiki>"http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English"</nowiki>;
};</code>|=
};</code>|EXAMPLE3=
____________________________________________________________________________________________
____________________________________________________________________________________________


 
| [[ctrlHTMLLoaded]], [[loadFile]], [[preprocessFile]], [[preprocessFileLineNumbers]], [[HTML File Format]] |SEEALSO=
| [[ctrlHTMLLoaded]], [[loadFile]], [[preprocessFile]], [[preprocessFileLineNumbers]] |SEEALSO=
 
}}
}}


Line 44: Line 45:


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|HTMLLOAD]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA|HTMLLOAD]]
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
Line 59: Line 60:
<br/>htmlLoad works with URL's as well as html files.
<br/>htmlLoad works with URL's as well as html files.
</dd>
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on September 7, 2014 - 19:35 (UTC)</dd>
<dd class="notedate">Posted on September 7, 2014 - 19:35 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
Line 69: Line 66:
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.
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.
</dd>
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on April 21, 2015 - 18:08 (UTC)</dd>
<dd class="notedate">Posted on April 21, 2015 - 18:08 (UTC)</dd>
<dt class="note">[[User:Benargee|Benargee]]</dt>
<dt class="note">[[User:Benargee|Benargee]]</dt>
<dd class="note">Example use of URL can be found in [[BIS_fnc_GUInewsfeed]] with the function browser.
<dd class="note">Example use of URL can be found in [[BIS_fnc_GUInewsfeed]] with the function browser.
</dd>
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on October 7, 2015 - 22:03 (UTC)</dd>
<dd class="notedate">Posted on October 7, 2015 - 22:03 (UTC)</dd>
<dt class="note">[[User:Tupolov|Tupolov]]</dt>
<dt class="note">[[User:Tupolov|Tupolov]]</dt>
<dd class="note">
<dd class="note">
(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
(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:<br><br>
<br><br>
'''Script Example''':
'''Script Example''':
<code>_newsOnline = <nowiki>"http://alivemod.com/alive_news.php?map=" + _map + "&mission=" + _mission + "&player=" + _player;</nowiki>
<code>_newsOnline = <nowiki>"http://alivemod.com/alive_news.php?map=" + _map + "&mission=" + _mission + "&player=" + _player;</nowiki>
_ctrlHTML htmlLoad _newsOnline;</code>
_ctrlHTML htmlLoad _newsOnline;</code>
'''Config Example:'''<br>
'''Config Example:'''<br>
<code>class CfgCommands {
<syntaxhighlight lang="cpp">
class CfgCommands {
   allowedHTMLLoadURIs[] += {
   allowedHTMLLoadURIs[] += {
       <nowiki>"http://alivemod.com/alive_news.php*"</nowiki>
       "http://alivemod.com/alive_news.php*"
   };
   };
};</code>
};</syntaxhighlight>
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Revision as of 00:09, 11 March 2020

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

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.). The command is subject to restrictions, imposed by CfgCommands class.
For unknown reasons, URL's length is limited to 255 characters.
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"; // link
Example 3:
Display news item:[] 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

See also:
ctrlHTMLLoadedloadFilepreprocessFilepreprocessFileLineNumbersHTML File Format

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*"
   };
};