Alerting

how to use jquery in Djnago

lahariveerlapat
Explorer

I have a requirement on clicking of the dropdown,a multidropdown search should trigger.This can be done using jquery but i am unable to include jquery plugin into django in my app.Please help me out

Tags (3)

martin_mueller
SplunkTrust
SplunkTrust

Copy the second example into a new Django view, see if it works, and when it does you adapt from there.

0 Karma

lahariveerlapat
Explorer

Am not able to find the solution from below link.can u please tell if any other possible solution is available

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

You should have the $ functions available after {% load splunkmvc %} without manually requiring JQuery. Take a look at the second example on http://dev.splunk.com/view/webframework-splunkjsstack/SP-CAAAESW - that uses $('#elementid') without any manual loading of JQuery.

0 Karma

aelliott
Motivator

Try

require(["splunkjs/ready!","underscore","jquery","myAddon"], function(mvc,_, jQuery,myAddOn) {

Also, I would add this code before including your javascript file in the page
(This assumes your javascript file is in your appname/django/appname/static/appname

What error are you getting?

martin_mueller
SplunkTrust
SplunkTrust

Make sure you have the JS Console open (F12 in many browsers).

0 Karma

lahariveerlapat
Explorer

I am not getting any error but the functions are not working.

0 Karma

lahariveerlapat
Explorer

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

JQuery should be a part of the web framework already.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...