GetBrowserTitle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (fix oop)
No edit summary
Line 22: Line 22:
function()
function()
outputChatBox("List of browser titles:")
outputChatBox("List of browser titles:")
for k, v in pairs( getElementByType("web-browser") ) do
for k, v in pairs( getElementsByType("web-browser") ) do
outputChatBox(k .. ". " .. getBrowserTitle(v))
outputChatBox(k .. ". " .. getBrowserTitle(v))
end
end

Revision as of 12:55, 16 November 2016

This function returns the title of the passed browser.

Syntax

string getBrowserTitle ( browser webBrowser )

OOP Syntax Help! I don't understand this!

Method: browser:getTitle(...)
Variable: .title


Required arguments

  • webBrowser: The browser

Returns

Returns the title as a string. Returns false if invalid arguments were passed.

Example

addCommandHandler("browsers",
	function()
		outputChatBox("List of browser titles:")
		for k, v in pairs( getElementsByType("web-browser") ) do
			outputChatBox(k .. ". " .. getBrowserTitle(v))
		end
	end
)

See Also