Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery. Send ajax query for each row in table
    primarykey
    data
    text
    <p>I have found many answers about my problem, but problem not resolved</p> <p>I have table, with data, example:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td class="editable"&gt; &lt;a id="query" href="#"&gt; Data 1 &lt;/a&gt; &lt;/td&gt; &lt;td class="editable"&gt; &lt;a id="text" href="#"&gt; Data 2 &lt;/a&gt; &lt;/td&gt; &lt;td class="editable"&gt; &lt;a id="foo" href="#"&gt; Data 3 &lt;/a&gt; &lt;/td&gt; &lt;td class="editable"&gt; &lt;a id="bar" href="#"&gt; Data 4 &lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="editable"&gt; &lt;a id="query" href="#"&gt; Data 1 &lt;/a&gt; &lt;/td&gt; &lt;td class="editable"&gt; &lt;a id="text" href="#"&gt; Data 2 &lt;/a&gt; &lt;/td&gt; &lt;td class="editable"&gt; &lt;a id="foo" href="#"&gt; Data 3 &lt;/a&gt; &lt;/td&gt; &lt;td class="editable"&gt; &lt;a id="bar" href="#"&gt; Data 4 &lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>I need:</p> <p>For each row in this table, get values of links with id="query" and id="foo" in current row and send ajax query</p> <p>I try to do this:</p> <pre><code> $("#detect_rel").click(function(){ $('tr').each(function() { // ajax to: ajax.php?query=xxxx&amp;data=&amp;xxxxx }); }); </code></pre> <p>But i cant get inner text of <code>&lt;a id="query"...</code> and <code>&lt;a id="foo"...</code> both, for current row</p> <p>I tried something like this:</p> <pre><code>$('tr').each(function() { var cols = $('.1, .2', this); // do something with cols }); </code></pre> <p>But it doens't help, because i cant (mb not enough js knowledges) get inner text of <code>&lt;a id="query"...</code> and <code>&lt;a id="foo"...</code> both, for current row</p> <p>Pseudocode:</p> <blockquote> <p>get row</p> <pre><code>get value of link in column_one and column_two send ajax query </code></pre> <p>get next row</p> <p>etc</p> </blockquote> <p>NOTE: <code>&lt;a href...</code> at each cell, needed for 'bootstrap x editable', and cuz of it, i need use id at each link</p> <hr> <p><strong>PROBLEM RESOLVED, thanks guys</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload