So I have a big goal I'm trying to accomplish but since I haven't gotten an answer yet I think its too broad and I realize I may be missing some Ajax/jQuery fundamentals so I want to start a fresh post here to get any help I can.
I have an HTML button that calls this inline JS:
<script type="text/javascript" >
$(function() {
//var currID = <?php echo ($currID); ?>;
$(".update_button").click(function() {
$.post("liveNews.php", {'currID[]': ["2806","2143","2139"]},
function(data) {
alert("Data Loaded: " + data);
});
});
});
</script>
At the moment I get an alert button, but only with the "Data Loaded: " text, the data is blank. As a new person to ajax what can I put in my php file to get data that I can use? Meaning can I make it give me all the html I need to populate for a new post, or should I only have it return portions of data that I then have to format to display the way I want?
Also at the moment is this the right way to send to the liveNews.php so that it can actually receive the array to use in filtering out which post to not query?
Thank you in advance for any guidance I can get with this.