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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...