All Apps and Add-ons

Web Framework Require Local File

alacercogitatus
SplunkTrust
SplunkTrust

Hello, in developing a new app, I want to referance a local file, not a website.

I have this: require(["https://code.jquery.com/ui/1.10.0/jquery-ui.js"], but want it to be local to the /appserver/static folder.

How to achieve?

In case of any clarifications please revert.

0 Karma
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

Found it. I did this:

require(["{{SPLUNKWEB_URL_PREFIX}}/static/app/APPNAME/jquery-ui.js"]

View solution in original post

alacercogitatus
SplunkTrust
SplunkTrust

Found it. I did this:

require(["{{SPLUNKWEB_URL_PREFIX}}/static/app/APPNAME/jquery-ui.js"]

alacercogitatus
SplunkTrust
SplunkTrust

It's built in to Splunk 6, no additional django items needed. A little more seamless, IMHO. Splunk 5 - Definitely requires Django framework.

0 Karma

aelliott
Motivator

Gotcha, thanks.. I've only used the django framework, Is there a reason you choose the html dashboards over django?

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

Right in the HTML Dashboard. I'm using Splunk 6.

0 Karma

aelliott
Motivator

What file do you place that in?

0 Karma

aelliott
Motivator

Put the javascript file in Splunk/etc/apps/MyAppName/django/MyAppName/static/MyAppName

Add this to html file in Splunk/etc/apps/MyAppName/django/MyAppName/templates

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...