0
I have a table with automatically generated links and values being passed via json.
The link returns the correct values being generated using PHP.
<li>
<a href='phpProcess/showFormDelegationPr.php?prId="+item.pr_id+"' class='link-form-delegation' id='show-form-delegation'>
<i class='fa fa-user'></i> Delegar
</a>
</li>
I want to pass the values to PHP using jquery, but I’m not succeeding.
I tried with the code below:
$("#consult").on("click", ".link-form-delegation", function(e){
e.preventDefault();
$.ajax({
url: $("#show-form-delegation").attr("href"),
type: 'GET',
success: function(data){
alert(data);
}
});
});
The problem is that for all table rows Alert always shows the return value of the first table row.
If the problem is in the return, it must be on the server side, not in jquery.
– bfavaretto
I did a test to check the return value without the jquery call, the value returned by PHP is correct.
– RRV