• 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

Send same name multiple checkbox values via ajax

Issue saving card for customer

WAMP Virtual Host not working

How to use React Router with Laravel?

Display the default discounted price and percentage on Woocommerce products

Installing Composer - Internal Error

How to generate QR CODE for dynamic generating link and logo using Simple QrCode in laravel?

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

Laravel relationship belongsToMany with composite primary keys

Convert date and time to Jalali in Laravel

how to hide previous markers when new markers added in google map javascript api

If you intend you use SMTP, add your SMTP Code after this Line

Can't exclude directories from .htaccess mobile redirect?

PHP contact form configuration [duplicate]

Return multiple values from a function using mysqli_fetch_assoc [closed]

About Contact Privacy policy Terms and conditions