Skip to main content
MediaBeacon University

Using Advanced Javascript Options

Version: 8.6, 2018.x, 2019.x

Issue

When using several of the "Enable javascript on" features in Manage Workspace, adding Client-Side Javascript will remove the standard functionality. If the intent is to add a function, and not replace it completely, additional code is needed. The following options are affected:

  • Advanced Javascript Options:
    • Enable javascript on direct download
    • Enable javascript on home button click
  • Notification Center Options:
    • Enable javascript on direct download
  • View Widgets
    • Advanced Options > Run javascript on page load

Resolution

To cause these options to perform the original behavior in addition to the Client-Side Javascript, add the following:

theCallback.onSuccess(true);

As an example, if added to the "Advanced Javascript Options: Enable javascript on direct download" section, the following code will cause an alert box to be shown, only letting the download proceed when the user clicks the Javascript alert box's "OK" button.

alert('I'm downloading!');
theCallback.onSuccess(true);

View Component "Run javascript on page load" format

alert('I'm loading!');
theCallback();
  • Was this article helpful?