Hi does anyone know how to stop json data from outputting in the browser before the page loads in? The data being echoed in included php script with
echo json_encode($row);
But ‘echo’ is what gives me access to the data in my $.ajax functions.
Thanks in advance
From what you are saying in your question and your comment on an earlier answer, you have a
voting.phpscript which includes another script, saydata.php. The latter doesecho json_encode($row), which causes unwanted data in the output fromvoting.php. You wantvoting.phpto load the data fromdata.phpusing the jQuery$.ajaxfunction.data.phpinvoting.php.$.ajaxcalls after the page produced byvoting.phphas loaded, i.e. when the DOM is ready, using the jQuery ready event.The ready event: