• 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

Creating live search with AJAX and CodeIgniter

Laravel Mix Uncaught ReferenceError: $ is not defined

Update Order custom Field value with WooCommerce REST API

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

Get image type from base64 encoded src string

PHP echo values of all sub keys [duplicate]

how to pass row id in href of a tag in codeigniter controller?

Navigation idle on content download

Transpose csv file data [duplicate]

Open a popup box after receiving result from ajax

Composer fails with kylekatarnls/update-helper on new homestead

PHP, how to convert Int value to Week days

How to find phpcs current default standard

PHP Print to Network Printer

About Contact Privacy policy Terms and conditions