• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to get AJAX to post on second page?

javascriptphpjqueryajax


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>

Related Snippets

JQuery content editable div and text box on submit not sending POST

protect my blog content

Laravel multi auth - Authentication user provider [] is not defined

Don't show recurring price for WooCommerce subscriptions worth 0$

ORA-12546: TNS:permission denied error connection to remote oracle server

stay with the last 15 elements of an array [duplicate]

Dynamic dropdown Ajax PHP request

Project structure for PHP

Getting public posts of a random user from Facebook API

What is PHP's equivalent of JavaScript's "array.every()"?

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

Star and Half Star Rating in Laravel

How to unlink image from folder?

Group data in a multidimensional array based on two columns

What is the function of the (new Date()).getTime() in PHP?

About Contact Privacy policy Terms and conditions