Dashboards & Visualizations

Why is JavaScript not loading after renaming?

rendie
Path Finder

Hello,
I want to write a custom panel and use for it js library vis.js,
but when I name this library and my js with script="vis.js, my.js", then js does not load.

In my js I use this example:

require([
"splunkjs/mvc",
"jquery",
'splunk.util',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!'
], function(
mvc,
$,
splunkUtil,
TableView
) {
console.log("Start");
});
0 Karma
1 Solution

gaurav_maniar
Builder

Hi,

I have tested your script and its working fine on my system.
Just to confirm and correct the script location - $SPLUNK_HOME/etc/apps/<app_name>/appserver/static

If still its not working, check your chrome console and share the error logs if there.

Another check,
Most of the times, js are not cleared from browser cache and even after updating the js in backend, browser still loads the old js.
In Splunk goto - https://your_splunk_server:8000/_bump and click the Bump Version and refresh your dashboard.

View solution in original post

0 Karma

gaurav_maniar
Builder

Hi,

I have tested your script and its working fine on my system.
Just to confirm and correct the script location - $SPLUNK_HOME/etc/apps/<app_name>/appserver/static

If still its not working, check your chrome console and share the error logs if there.

Another check,
Most of the times, js are not cleared from browser cache and even after updating the js in backend, browser still loads the old js.
In Splunk goto - https://your_splunk_server:8000/_bump and click the Bump Version and refresh your dashboard.

0 Karma

rendie
Path Finder

all problems in cache, thanks

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi rendie,
wher did you locate your js?
is must be in $SPLUNK_HOME/etc/apps/appserver/static

Ciao.
Giuseppe

0 Karma

rendie
Path Finder

Yes, all scripts in $SPLUNK_HOME/etc/apps/appserver/static

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...