All Apps and Add-ons

STOP HTML module javascript href from bleeding into Table module below

subtrakt
Contributor

Hi Friends!
Trying to figure out why the href links from the HTML module is bleeding into the table module when the HTML should be isolated. The only way i can fix it is to put a timeselector module in between them but i don't need a timeselector module.

Essentially, when you click anything on the lower 'table' module it puts you in test2 href from the upper HTML module... Shouldn't "" prevent that?

     <param name="html">&lt;script type="text/javascript"&gt;
     popupWindow = window.open(
                url,'popUpWindow','height=500,width=850,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
            }
        &lt;/script&gt;

                &lt;table&gt; &lt;tr&gt;&lt;td width='100%'&gt;&lt;/td&gt;&lt;td align='left'&gt; 
              &lt;/td&gt;
              &lt;a align='left' target="self" href="test1"&gt;&lt;b&gt;&#9668;test1&#9658;
             &lt;a align='left' target="self" href="test2"&gt;&lt;b&gt;&#9668;test2&#9658;
            &lt;/tr&gt;
           &lt;/table&gt;
  </param>
        </module>  



  <module name="HiddenSavedSearch" layoutPanel="panel_row2_col1" group="test3" autoRun="True">
        <param name="useHistory">True</param>
        <param name="savedSearch">test3</param>
        <module name="JobProgressIndicator" />
        <module name="Paginator">
            <param name="count">10</param>
            <param name="entityName">results</param>
              <module name="Table" layoutPanel="panel_row2_col1">
    <param name="count">1000</param>
        </module>
        </module>
        </module>
0 Karma

sideview
SplunkTrust
SplunkTrust

Anything you can do to preserve readability is pretty essential to success. In this case, I strongly recommend using CDATA to escape your HTML contents rather than manually escaping the characters. If I rewrite your XML this way and with proper indentation, it becomes very obvious what the problem is. The actual content of the table cell was output after the closing `` tag. Browsers will just sort of dump this content out and in this case it ended up overlapping the next element.

<module name="HTML" layoutPanel="viewHeader">
   <param name="html"><![CDATA[
<script type="text/javascript">
  popupWindow = window.open(url,'popUpWindow','height=500,width=850,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
   }
</script>

<table>
  <tr>
    <td width='100%'></td>
    <td align='left'></td>
      <a align='left' target="self" href="test1"><b>&#9668;test1&#9658;
      <a align='left' target="self" href="test2"><b>&#9668;test2&#9658;
  </tr>
</table>
]]></param>
</module>

Just move those elements inside the TD and the problem will go away. Also, there are no closing tags for your or <b> tags and you should get those in there too.

0 Karma

subtrakt
Contributor

and because /a /b were missing on the

0 Karma

subtrakt
Contributor

Figured it out - looks like the javascript was the culprit. Here's what i replaced the old javascript with.

   <module name="HTML" layoutPanel="viewHeader">
      <param name="html">&lt;script type="text/javascript"&gt;
        // Popup window code
            popupWindow = window.open(
                url,'popUpWindow','height=500,width=850,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
            }
        &lt;/script&gt;
        &lt;a align='left' target="self" href="test1"&gt;&lt;b&gt;&#9668;test1&#9658;&lt;/b&gt;&lt;/a&gt;
               &lt;a align='left' target="self" href="test2"&gt;&lt;b&gt;&#9668;test2&#9658;&lt;/b&gt;&lt;/a&gt;

       </param>
    </module>
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Mile High Learning with Splunk University, Denver, Colorado

If Denver is known for its mile-high elevation, Splunk University is about to raise the bar on technical ...

IT Service Intelligence 5.0 Series: Your Guide to the June Launch

We are excited to announce the June release of Splunk IT Service Intelligence (ITSI) 5.0. This update ...

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...