i'm trying to make a call to the file using ajax using the following code
var text = '<?php echo urlencode("hello world"); ?>';
var dataTable = $("#datatable-pan").DataTable({
"ordering": false,
"searching": false,
"bProcessing": true,
"serverSide": true,
"ajax":{
url :'my_response.php?text='+text, // json datasource
type: "POST", // type of method ,GET/POST/DELETE
error: function(){
$("#employee_grid_processing").css("display","none");
}
},
});
This works fine but if i change the value of var text to
var text = '<?php echo urlencode("hello 'world'"); ?>';
it doesn't proceed and does not call the file it shows something like xhr error