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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...