RedirectToUrl()

A RedirectToUrl() function will redirect a user to a specified URL that will be open in a specified target (new, current or popup window/tab). An optional confirmation prompt message can be also provided.

Syntax

RedirectToUrl(url,target);
RedirectToUrl(url,target,confirmText);

Function arguments

  • url– (String) a URL to be redirected to;
  • target – (String) a redirection target window/tab. This parameter can have values 'new’, 'current’ or 'popup’;
  • confirmText – (String) [Optional] an optional text for the redirection prompt. If not used, a user will not be prompted.

Return value

This function returns String. The RedirectToUrl() function always returns an empty string.

Examples

Example 1

This will redirect a user to the given URL („https://www.google.com„) and will open it in a new window/tab.

RedirectToUrl("https://www.google.com","new");