• 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

Check If array is null or not in php

Issue saving card for customer

Fatal error: Trait 'LaminasDbAdapterLaminasDbAdapterAdapterInterface' not found in /var/www/vendor/laminas/laminas-db/src/Adapter/Adapter.php

How can I access an array/object?

Use same method for inertia response and json response Laravel Jetstream

Problems getting instance of UploadedFile in Yii2

how to remove white space in select 2

How to get page number on dompdf PDF when using "view"

get data-value with variable value

Yii Ajax Submit button

Cache clear probem in Larave

Show only featured products in Woocommerce shop page

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

Mysqli Output to a table

500 Internal Server Error on Ajax request. Not sure the origin of the problem

About Contact Privacy policy Terms and conditions