getPageInfo() for Salesforce Classic

Returns information about the current page.

NameTypeDescription
callbackfunctionJavaScript method executed when the API method call is completed.
NameTypeDescription
resultstringReturns the URL of the current page as a JSON string, including any applicable object ID, object name, object type, and for API version 33.0 or later, the object tab name. For API version 31.0 and later, invoking this method on a PersonAccount object also returns accountId or contactId, and personAccount (true if the object is a PersonAccount, false otherwise).
errorstringIf the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message.

Example result:

Example result for a PersonAccount object (API version 31.0 and later):