BROWSE function

BROWSE(Address, Target?, NamedTarget?) BROWSE(Address; Target?; NamedTarget?)

Address

Text

The web address (URL) to open.

Target

(optional)

The target where the web page should be opened. Refer to the main text for the allowed values. If omitted, BrowseTarget.DefaultBrowseTarget,Default is assumed.

NamedTarget

Text (optional)

The name of the window or tab where the address should be opened. This parameter is only considered if the Target parameter is set to BrowseTarget.Named or is omitted. Unusually, this parameter can be given in place of the Target parameter.

Returns

Nothing

This function does not return a value.

Opens a web browser, or a window or a tab, displaying the given web address. BROWSE("https://www.calcapp.net")BROWSE("https://www.calcapp.net") displays the Calcapp website.

This function can only be used from an action formula. It is typically invoked from a formula associated with the OnPress property of a formula button.

The optional Target parameter may be provided to determine where the web page is opened. These are the allowed values:

Value Meaning
BrowseTarget.​Default The behavior depends on the default browse target. This setting may be changed in Calcapp Creator, in the inspector for the start screen of your app, under Browse target. If the default setting is used, the web page is opened in a new window or tab (equivalent to BrowseTarget.​Self), but only if the app is run as a standalone app. If the app is embedded in a website, the web page is opened in the current tab or window (equivalent to BrowseTarget.​Top).
BrowseTarget.​Self The web page is opened in the current tab or window. If the app is embedded in a website, the web page replaces the app (the iframe it is part of), but not the web page as a whole.
BrowseTarget.​Blank The web page is opened in a new tab or window.
BrowseTarget.​Parent The web page is opened in the current tab or window, if the app is run as a standalone app. If the app is embedded in a website, the web page replaces the parent of the iframe the app is part of. If the parent is another iframe, that iframe is replaced by the web page. If the parent is the top-level web page, the web page is opened in the current tab or window.
BrowseTarget.​Top The web page is opened in the current tab or window, if the app is run as a standalone app. If the app is embedded in a website, the web page is opened in the current tab or window.
BrowseTarget.​Named The web page is opened in a new tab or window with the name indicated by the NamedTarget parameter. If a web page has not already been opened in a tab or window with the given name, a new tab or window is opened. Otherwise, the web page is opened in the tab or window with the given name.

Examples

BROWSE("https://www.calcapp.net")BROWSE("https://www.calcapp.net")

Displays the Calcapp website in a web browser.

BROWSE("https://www.calcapp.net", BrowseTarget.Blank)BROWSE("https://www.calcapp.net"; BrowseTarget,Blank)

Displays the Calcapp website in a web browser, specifically in a new window or tab.

BROWSE("https://www.calcapp.net", IF(Settings!OpenLinksInNewTabs, BrowseTarget.Blank, BrowseTarget.Self))BROWSE("https://www.calcapp.net"; IF(Settings!OpenLinksInNewTabs; BrowseTarget,Blank; BrowseTarget,Self))

Displays the Calcapp website in a web browser. If the value of the OpenLinksInNewTabs switch field, on the Settings screen, is TRUE, the web page is opened in a new window or tab. Otherwise, it is opened in the same window or tab.

BROWSE("https://www.calcapp.net", BrowseTarget.Named, "calcapp")BROWSE("https://www.calcapp.net"; BrowseTarget,Named; "calcapp")

Displays the Calcapp website in a web browser, in a window or tab named "calcapp." If no such window or tab exists, a new window or tab is created. Otherwise, the existing window or tab is used to load the given web address.

BROWSE("https://www.calcapp.net", "calcapp")BROWSE("https://www.calcapp.net"; "calcapp")

Displays the Calcapp website in a web browser, in a window or tab named "calcapp." If no such window or tab exists, a new window or tab is created. Otherwise, the existing window or tab is used to load the given web page. This example is identical to the prior example, but is shorter, as the second parameter is omitted.