How to get AJAX to post on second page?
PHP Snippet 1:
$( document ).ready(function() {
$("button").click(function() {
var dataPoint = "chunk of data";
///////// AJAX //////// AJAX //////////
$.ajax({
type: 'POST',
url: 'some_page_name.php',
data: {dataPoint:dataPoint},
success: function( response ){
$('#success').html("Sent!!");
}
});
///////// AJAX //////// AJAX /////////
});
PHP Snippet 2:
<button>Click me</button>
<div id="success"></div>