Created
September 15, 2015 21:27
-
-
Save LukeMurphey/38dcf31ca9e5a0ca29fc to your computer and use it in GitHub Desktop.
Illustrates how to conditionally load dashboard.js in Splunk #Splunk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require([ | |
| "splunkjs/mvc", | |
| "underscore", | |
| "jquery", | |
| "splunkjs/mvc/utils" | |
| ], | |
| function( | |
| mvc, | |
| _, | |
| $, | |
| utils ) { | |
| // Try to load dashboard.js | |
| require(['../app/' + utils.getCurrentApp() + '/dashboard'], function () { | |
| console.log("Successfully loaded dashboard.js"); | |
| }, function (error) { | |
| console.warn("Unable to load dashboard.js"); | |
| }); | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment