• 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

How to get values inside <![CDATA[values]] > using php DOM?

Form Validation and Submission to database

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

Add restriction to WooCommerce coupons by allowed user ID

Laravel - Browser displays message again when I press back button

Get keys from associative array [duplicate]

PHPUnit (Phar) Fatal Error Only When Test Fails

ConstraintViolationListInterface to Exception in Symfony

Find out the name of the last script that included the current one

Insert a DIV after the 6th product only once in WooCommerce category archives

Error converting docx to pdf using Unoconv

retrieve data from database using session

PHP Get value from JSON [duplicate]

merge all files in directory to one text file

Symfony there are no commands defined in the "make" namespace

About Contact Privacy policy Terms and conditions