<?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: jquery dashboard in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/jquery-dashboard/m-p/366690#M23958</link>
    <description>&lt;P&gt;@csimonnet if this is working for you in HTML and not in Splunk, can you share a screenshot of what output you need from your HTML code? Also what is the CDN/reference URL for clock and weather JavaScript libraries?&lt;/P&gt;</description>
    <pubDate>Wed, 09 May 2018 18:45:29 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-05-09T18:45:29Z</dc:date>
    <item>
      <title>jquery dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/jquery-dashboard/m-p/366689#M23957</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I would like to have the weather on a panel in my dashboard. My code works but not with Splunk.&lt;BR /&gt;
xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="clock.js, weather.js" stylesheet="clock.css, weather.css"&amp;gt;
 &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;div class="weather" id="weather"&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;javascript:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
       "splunkjs/ready!",
       "splunkjs/mvc/simplexml/ready!",
       "jquery"
     ], function($) {

$(document).ready(function() {
var weatherUrl = 'https://query.yahooapis.com/v1/public/yql?q=select%20item.condition%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22lyon%22)%20and%20u%3D%22c%22&amp;amp;format=json&amp;amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys'

$.getJSON(weatherUrl,function(data) {
var result = data.query.results.channel.item.condition;
var code = result.code;
var currently = result.text; 
var temp = result.temp; 
var image = 'https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/' + result.code + 'd.png';
var units = 'C'


html = '&amp;lt;h2&amp;gt;&amp;lt;i class="icon-'+code+'"&amp;gt;&amp;lt;/i&amp;gt; '+temp+'&amp;amp;deg;'+units+'&amp;lt;/h2&amp;gt;';
 html += '&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;'+'Lyon'+', '+'France'+'&amp;lt;/li&amp;gt;';
html += '&amp;lt;li class="currently"&amp;gt;'+currently+'&amp;lt;/li&amp;gt;';
 $("#weather").html(html);

});
});
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I have to do?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 15:17:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/jquery-dashboard/m-p/366689#M23957</guid>
      <dc:creator>csimonnet</dc:creator>
      <dc:date>2018-04-27T15:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: jquery dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/jquery-dashboard/m-p/366690#M23958</link>
      <description>&lt;P&gt;@csimonnet if this is working for you in HTML and not in Splunk, can you share a screenshot of what output you need from your HTML code? Also what is the CDN/reference URL for clock and weather JavaScript libraries?&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 18:45:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/jquery-dashboard/m-p/366690#M23958</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-09T18:45:29Z</dc:date>
    </item>
  </channel>
</rss>

