IsBrowserLoading: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client_function}} This function checks if a browser is currently loading a website. ==Syntax== <syntaxhighlight lang="lua"> bool isBrowserLoading ( browser webBrowser ) </syntaxhighlight> ...")
 
m (Link to the Romanian translation of this page added.)
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Client_function}}
{{Client function}}
{{New feature/item|3.0150|1.5||
This function checks if a browser is currently loading a website.
This function checks if a browser is currently loading a website.
}}


==Syntax==
==Syntax==
Line 7: Line 9:
bool isBrowserLoading ( browser webBrowser )
bool isBrowserLoading ( browser webBrowser )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[Element/Browser|browser]]:isLoading|loading}}


===Required arguments===
===Required arguments===
*'''webBrowser:*** The browser
*'''webBrowser:''' The browser


===Returns===
===Returns===
Line 15: Line 18:


==Example==
==Example==
Todo
This example will add an command /checkload to check if the site is loading or not.
 
<syntaxhighlight lang="lua">
local webbrowser = createBrowser(1000, 1000, false, false)
loadBrowserUrl(webbrowser, "https://www.youtube.com/watch?v=jofNR_WkoCE")
addCommandHandler("checkload",
      function()
            if isBrowserLoading(webbrowser) then 
                  outputChatBox("Please  wait, The site is loading!")
            else
                  outputChatBox("This site was already loaded")
            end
      end
)</syntaxhighlight>


==See Also==
==See Also==
Todo
{{CEF_functions}}
 
[[hu:isBrowserLoading]]
[[RO:isBrowserLoading]]

Latest revision as of 13:38, 8 April 2020

This function checks if a browser is currently loading a website.

Syntax

bool isBrowserLoading ( browser webBrowser )

OOP Syntax Help! I don't understand this!

Method: browser:isLoading(...)
Variable: .loading


Required arguments

  • webBrowser: The browser

Returns

Returns true if the browser is loading a website, false otherwise and nil if invalid arguments were passed.

Example

This example will add an command /checkload to check if the site is loading or not.

local webbrowser = createBrowser(1000, 1000, false, false)
loadBrowserUrl(webbrowser, "https://www.youtube.com/watch?v=jofNR_WkoCE")
addCommandHandler("checkload",
      function()
            if isBrowserLoading(webbrowser) then  
                  outputChatBox("Please  wait, The site is loading!") 
            else
                  outputChatBox("This site was already loaded")
            end
      end
)

See Also