I have an event from which I call the Ajax function. From this ajax function, I want to return a string, but the problem is that the function also calls some other functions and returns some value.
The problem is that the ajax called page returns all the sting that comes back from each function, I mean Inherited.
Ajax Event:
$(".close_some").on("click", function(){ $.get("close_some.php", { id : data_id, close_date_time : close_date_time }, function(response){ console.log(response); if(response === "success"){ document.location.reload(true); }else{ alert('Some problem'); } }); });
close_some.php
$col = someFunction($id); //this function also called another function where a return statement works include_once "some_page.php"; echo 'success';
SomeFunction ()
function someFunction($id){ $sql = "SELECT `demo` FROM `some_problems` WHERE id = '$id'"; ... return departmentName($dept_id); }
Now, when I see its long line in response , but I only need success , how can I delete other answers
Thanks at Advance.
user6364857
source share