GetBrowserSource: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 14: Line 14:
</syntaxhighlight>
</syntaxhighlight>


{{OOP||[[Element/Browser|Browser]].getSource||getBrowserSource}}
{{OOP||[[Element/Browser|Browser]].getSource}}


==Returns==
==Returns==

Revision as of 20:19, 15 September 2015

This function can be used to retrieve the source code of a website (asynchronously). The size of the source code is limited to 2 MiB (remaining bytes are cut).

Syntax

table getBrowserSource ( function callback )

Callback syntax

function ( string code )


OOP Syntax Help! I don't understand this!

Method: Browser.getSource(...)


Returns

Returns true if valid arguments have been passed, false otherwise.

Example

local browser = createBrowser(...)

-- Assuming a website has already been loaded
getBrowserSource(function(code)
    -- Output code
    outputChatBox(code)
end)

See Also