jQuery pass table row value to ajax post request -



jQuery pass table row value to ajax post request -

i'm trying send value of table cell jquery post script. $.ajax part works when hard coding values. guess i'm doing wrong assigning "extension" variable in jquery.

below jquery script:

<script> function mycall() { $(".btn btn-warning btn-sm").click(function () { var extension = $(this).closest("tr").find(".extension").text(); } $.ajax("/cura/pages/test.php/",{ type: "get", data:{ action:'pause', pauselocation: $extension, queue: 'testq', paused: 'true' } }); request.done(function(msg) { $("#mybox").html(msg); }); request.fail(function(jqxhr, textstatus) { alert( "request failed: " + textstatus ); }); }

any suggestions?

do this:

$(".btn btn-warning btn-sm").click(function () { var extension = $(this).closest("tr").find(".extension").text(); $.ajax("/cura/pages/test.php/",{ type: "get", data:{ action:'pause', pauselocation: extension, queue: 'testq', paused: 'true' }); });

jquery ajax table post

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

ubuntu - Bash Script to Check That Files Are Being Created -

Php operator `break` doesn't stop while -