I want to pass js variables to an $.ajax function, like:
function myCall(elm) {
var table = $('#realtime').dataTable();
var extension = $(elm).closest("tr").find('td.extension').text();
var agent = $(elm).closest("tr").find('td.name').text();
alert(extension);
$.ajax("/cura/pages/realtime/test.php/",{
type: "GET",
data: {action:'agentpause',pauselocation: extension,queue: 'testq',paused: 'true'}
});
}
Only extension is a variable, rest hard coded. Then it doesn't work. If i hard code the value for extension variable, then the $.ajax call is successful. What's going wrong with passing extension variable?