BrowserLoadingFailed: Difference between revisions
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
This event is called everytime a CEF Browser loading fails. | This event is called everytime a CEF Browser loading fails. | ||
== C# Syntax == | |||
{{CSharp| | |||
<pre> | |||
public delegate void OnBrowserLoadingFailedDelegate(HtmlWindow window); | |||
</pre> | |||
}} | |||
=== Parameters === | |||
* '''window''': The created browser handler, output expects <span style="color: #408DAE"><b>RAGE.Ui.HtmlWindow</b></span> type. | |||
=== Examples === | |||
The example below shows a message to player when a browser fails to load. | |||
<syntaxhighlight lang="c#"> | |||
Events.OnBrowserLoadingFailed += OnBrowserLoadingFailed; | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="c#"> | |||
public void OnBrowserLoadingFailed(RAGE.Ui.HtmlWindow window) | |||
{ | |||
RAGE.Chat.Output($"The browser window {window.Url} failed to load"); | |||
} | |||
</syntaxhighlight> | |||
== JavaScript Syntax == | == JavaScript Syntax == | ||
| Line 11: | Line 34: | ||
* '''browser''': The browser handler, output expects <span style="color: #408DAE"><b>any</b></span> type. | * '''browser''': The browser handler, output expects <span style="color: #408DAE"><b>any</b></span> type. | ||
== Examples == | === Examples === | ||
The example below shows up a message for a player when a CEF Browser loading fails. | The example below shows up a message for a player when a CEF Browser loading fails. | ||
Revision as of 23:40, 26 November 2018
Client-Side
This event is called everytime a CEF Browser loading fails.
C# Syntax
C#
public delegate void OnBrowserLoadingFailedDelegate(HtmlWindow window);
Parameters
- window: The created browser handler, output expects RAGE.Ui.HtmlWindow type.
Examples
The example below shows a message to player when a browser fails to load.
Events.OnBrowserLoadingFailed += OnBrowserLoadingFailed;
public void OnBrowserLoadingFailed(RAGE.Ui.HtmlWindow window)
{
RAGE.Chat.Output($"The browser window {window.Url} failed to load");
}
JavaScript Syntax
JavaScript
mp.events.add('browserLoadingFailed', (browser) => {});
Parameters
- browser: The browser handler, output expects any type.
Examples
The example below shows up a message for a player when a CEF Browser loading fails.
mp.events.add('browserLoadingFailed', (browser) => {
mp.gui.chat.push('Oh boy, your browser failed to load :/');
});