title: Pass values from a row to another JSP using jquery
body: <p>I'm trying to get row values from a bootstrap table to send them to another JSP document while using jQuery, however seems like I can't find a proper way to do that.</p>
  
  <pre><code>&lt;table class="table table-hover"&gt;
              &lt;thead&gt;
                  &lt;%
                      int serial = 0;
                      int id = 0;
                      String name = null;
                      double ammount = 0;
                      String date = null;
                      User user = null;
                  %&gt;
                  &lt;tr&gt;
                      &lt;th&gt;&lt;%="Serial"%&gt;&lt;/th&gt;
                      &lt;th&gt;&lt;%="Cost ID"%&gt;&lt;/th&gt;
                      &lt;th&gt;&lt;%="Cost Name"%&gt;&lt;/th&gt;
                      &lt;th&gt;&lt;%="Cost Ammount"%&gt;&lt;/th&gt;
                      &lt;th&gt;&lt;%="Cost Date"%&gt;&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                  &lt;%
                      try {
                          int id_id = (int) session.getAttribute("id");
                          List&lt;Object[]&gt; costs = scm.viewAll(sum.getUser(id_id));
                          for (Object[] cost : costs) {
                              id = (int) cost[0];
                              name = (String) cost[1];
                              ammount = (double) cost[2];
                              date = (String) cost[3];
                              serial += 1;
                  %&gt;
                  &lt;tr class="clickable-row" data-href="updatesingle"&gt;
                      &lt;td&gt;&lt;%=serial%&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%=id%&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%=name%&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%=ammount%&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;%=date%&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;%
                      }
                      } catch (Exception e) {
                          response.sendRedirect("home");
                      }
                  %&gt;
  </code></pre>
  
  <p>This code above is the table code. As you can see the rows are clickable and I'm redirecting to a new page(JSP) when a row clicked, using jQuery:</p>
  
  <pre><code>jQuery(document).ready(function($) {
          $(".clickable-row").click(function() {
              window.document.location = $(this).data("href");
          });
      });
  </code></pre>
  
  <p>What I'm trying to do, is to pass for example the Cost ID(id variable) value to the next JSP page and manipulate it in some way, and the value should be of the specific row I clicked on. Is there a way to do so? </p>
  
  <p>P.S I'm new to jQuery so please be gentle :) </p>