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
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 ...