Refine your search:

Is there a way to include jquery into setup.xml?

A simple example would be to show an alert box that says "Hello World"

asked 27 Jun '10, 07:36

Nicholas%20Key's gravatar image

Nicholas Key ♦♦
1.9k111
accept rate: 14%

edited 13 Mar, 13:33


2 Answers:

You can include an application.js file in your appserver/static directory, and it will be loaded into your setup.xml page. applicaiton.js can, in turn, load whatever other scripts it wants.

I believe that jquery is already part of Splunk, so you won't need to explicitly add jQuery yourself.

Note that application.js is loaded pretty late in the page display cycle, so the user will see the page before your script is loaded.

link

answered 07 Aug '10, 01:12

Justin%20Grant's gravatar image

Justin Grant
1.5k6740
accept rate: 50%

You can also include JavaScript directory in the setup page directly using a CDATA block inside of a text node. This is useful when you have JavaScript that you want to only execute on the setup page (otherwise, you'll need to check the URL to determine if the current page is the setup page).

Consider the following that open the jQueryUI date picker dialog when the input block is clicked:

      <text>
      <![CDATA[
      <script>
          $(function() {
              $( "#datepicker" ).datepicker();
          });
      </script>

      <div class="demo">
          <p>Date: <input type="text" id="datepicker"></p>
      </div>
      ]]>
      </text>
link

answered 13 Mar, 21:09

LukeMurphey's gravatar image

LukeMurphey
5808
accept rate: 42%

Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2

Asked: 27 Jun '10, 07:36

Seen: 913 times

Last updated: 13 Mar, 21:09

Copyright © 2005-2012 Splunk, Inc. All rights reserved.