<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: including javascript in data &amp;gt; ui&amp;gt; alert &amp;gt; test.html , but javascript is not working in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/393239#M25731</link>
    <description>&lt;P&gt;Hi Jeffland,&lt;/P&gt;

&lt;P&gt;Thank you for taking time to reply to my query.&lt;/P&gt;

&lt;P&gt;I had read the article earlier which you suggested but it was ambiguous , under topic :Security Consideration  they says:&lt;/P&gt;

&lt;P&gt;"Except for a dynamic dropdown control, only static HTML markup should be used in the interface. Do not include scripts or other constructs that could put your system at risk."&lt;/P&gt;

&lt;P&gt;by this line it sounds like it is possible but recommended not to use it.&lt;/P&gt;

&lt;P&gt;As suggested by you , I have left my feedback on the article.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Amit Vikram  &lt;/P&gt;</description>
    <pubDate>Tue, 07 Aug 2018 18:54:58 GMT</pubDate>
    <dc:creator>avikramengg</dc:creator>
    <dc:date>2018-08-07T18:54:58Z</dc:date>
    <item>
      <title>including javascript in data &gt; ui&gt; alert &gt; test.html , but javascript is not working</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/393237#M25729</link>
      <description>&lt;P&gt;under this  folder structure &lt;/P&gt;

&lt;P&gt;├───appserver&lt;BR /&gt;
|----------------└───static&lt;BR /&gt;
|--------------------------└───test.js&lt;BR /&gt;
├───default&lt;BR /&gt;
│----------└───data&lt;BR /&gt;
│---------------------└───ui&lt;BR /&gt;
│-------------------------------└───alerts&lt;BR /&gt;
--------------------------------------------└───test.html&lt;/P&gt;

&lt;P&gt;I am trying to include a JavaScript code or JavaScript file under "test.html" but it is not happening &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form class="form-horizontal form-complex" script="test.js"&amp;gt;
    &amp;lt;input type="text" name="action.test.param.confgid" id="create_tests_confgid"   /&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;following code is written in test.js&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$(document).ready(function(){
  alert("testing the alert ");
  });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note : I am able to see the  form on web interface of splunk but the java script code is not executing .&lt;/P&gt;

&lt;P&gt;Can anyone help me to include the JavaScript code to specified code structure?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Amit Vikram &lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 14:39:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/393237#M25729</guid>
      <dc:creator>avikramengg</dc:creator>
      <dc:date>2018-08-06T14:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: including javascript in data &gt; ui&gt; alert &gt; test.html , but javascript is not working</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/393238#M25730</link>
      <description>&lt;P&gt;It is not possible to use javascript in custom alert html code. The docs themselves don't say this explicitly, but you can refer to the comments below the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/CustomAlertUI"&gt;appropriate documentation&lt;/A&gt; where SK8 asked the exact question.&lt;BR /&gt;
Feel free to leave feedback on that page requesting clarification (using the "Was this topic useful?"-section at the bottom), the docs team is super awesome and will appreciate your input.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 06:33:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/393238#M25730</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2018-08-07T06:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: including javascript in data &gt; ui&gt; alert &gt; test.html , but javascript is not working</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/393239#M25731</link>
      <description>&lt;P&gt;Hi Jeffland,&lt;/P&gt;

&lt;P&gt;Thank you for taking time to reply to my query.&lt;/P&gt;

&lt;P&gt;I had read the article earlier which you suggested but it was ambiguous , under topic :Security Consideration  they says:&lt;/P&gt;

&lt;P&gt;"Except for a dynamic dropdown control, only static HTML markup should be used in the interface. Do not include scripts or other constructs that could put your system at risk."&lt;/P&gt;

&lt;P&gt;by this line it sounds like it is possible but recommended not to use it.&lt;/P&gt;

&lt;P&gt;As suggested by you , I have left my feedback on the article.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Amit Vikram  &lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 18:54:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/393239#M25731</guid>
      <dc:creator>avikramengg</dc:creator>
      <dc:date>2018-08-07T18:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: including javascript in data &gt; ui&gt; alert &gt; test.html , but javascript is not working</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/393240#M25732</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;I also understand the Security Consideration, but have no other option than include a javascript code.&lt;BR /&gt;
I want to enable HTML email formatting inside a text box with WYSIWYG javascript interface like CKEditor.&lt;/P&gt;

&lt;P&gt;Who can advise a solution?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 13:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/393240#M25732</guid>
      <dc:creator>quzen</dc:creator>
      <dc:date>2020-02-27T13:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: including javascript in data &gt; ui&gt; alert &gt; test.html , but javascript is not working</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/541097#M37084</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/82006"&gt;@quzen&lt;/a&gt;&amp;nbsp;, I have a similar use case. Would like to allow users to format an HTML email message body, and need to minify and escape the HTML before passing as a parameter. Did you find a solution?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 23:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/541097#M37084</guid>
      <dc:creator>JTG</dc:creator>
      <dc:date>2021-02-23T23:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: including javascript in data &gt; ui&gt; alert &gt; test.html , but javascript is not working</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/541733#M37143</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231829"&gt;@JTG&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried different ways to include javascript into Alert HTML, even asked that question to Documentation team.&lt;/P&gt;&lt;P&gt;But in the end I haven't found a way to do that. Apparently it's just not allowed by the application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I finally did is created my own Send Formatted Email addon which allows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;select from a list of predefined email templates (base templates with general styling + header and footer)&lt;/LI&gt;&lt;LI&gt;format message body using HTML tags (ex. &amp;lt;h1&amp;gt;, CSS inline styling, etc.)&lt;/LI&gt;&lt;LI&gt;include inline table with results (the same way as in the default Splunk's Send email addon)&lt;/LI&gt;&lt;LI&gt;include inline dashboard screenshot (supports dynamic link with parameters from results)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Configured alert trigger looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="send_formatted_email.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13118i63AE7EF1C85226FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="send_formatted_email.png" alt="send_formatted_email.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And an email example looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="email_example.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13119i0C5D9FC1361592A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="email_example.png" alt="email_example.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 10:26:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/including-javascript-in-data-gt-ui-gt-alert-gt-test-html-but/m-p/541733#M37143</guid>
      <dc:creator>quzen</dc:creator>
      <dc:date>2021-03-01T10:26:27Z</dc:date>
    </item>
  </channel>
</rss>

