• 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 remove from a multidimensional array all duplicate elements including the original?

str_word_count() function doesn't display Arabic language properly

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

Get orders by date and status woocommerce

How to Display Data in Yajra Datatables Laravel 7?

PhpSpreadSheet: How to save Workbook sheets in individual CSV files

PHP my timezone is no setting up in PHP.ini File in xampp

PHPS source file - 403 Forbidden You don't have permission to access this resource

How to get an Array value inside an object in an array Php [duplicate]

PHP date() with timezone?

How can I get user id from session in javascript?

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

PHP Warning: Module already loaded in Unknown on line 0

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

About Contact Privacy policy Terms and conditions