i'm sending data to a javascript function from a php script with help of ajax.
echo json_encode($rows);
The issue i'm having is that i'm running the php script right when the page loads, and the output is then displayed on the page, which I dont actually want to display. I tried to hide the echo with ob_end_clean() but this kinda breaks everything.