• 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

possible options to create pdf file using html elements to generate invoice in php and codeigniter

Get orders by date and status woocommerce

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

Woocommerce product attributes with hierarchy like categories

What will the best solution for this multiple optional filter?

PHP function Not Working As Expected From functions.php Include File

Undefined variable in Laravel 8 project (php 7.4)

Google Gmail API - How to login programatically?

GuzzleHttp Hangs When Using Localhost

Add New Parameter to Existing URL using htaccess

How to make dot match newline characters using regular expressions

PHP array sort and remove duplicates by two field values

How to use functions that are declared in snippets in Evolution CMS (Modx) in an external PHP Script?

Can I use a WooCommerce function without any WooCommerce page?

How to identify whether webp image is static or animated?

About Contact Privacy policy Terms and conditions