• 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

Laravel Passport - Not able to get token string in response?

Eloquent insert id with sequence next value

insert multiple rows in a saveall in cakephp

Why does array_map() with null as callback create an "array of arrays"?

Laravel SQL query midnight time not showing

How to get result of the formula on import xlsx with maatwebsite using Laravel? I get formula and not value of the formula

Can I use a WooCommerce function without any WooCommerce page?

Symfony 4: how to allow dynamic values for array nodes in bundle configuration?

Mysqli multi query error

The sum of the user's points

how to insert data into select2 search input after scan using qrcode

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

Query Optimization, changing the queries in the loop into a single processing query

Remove product downloads section in woocommerce email notifications

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

About Contact Privacy policy Terms and conditions