• 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 convert time from one timezone to another in PHP

Reducing authentication calls on external API (Laravel 5.6)

CodeIgniter 4: Like and Dislike Functionality

Send same name multiple checkbox values via ajax

Reload parent page after submit in iframe

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

How can I get new CSRF token in LARAVEL by using ajax

Only on Firefox "Loading failed for the <script> with source"

CodeIgniter extend CI_URI undefined method

Update Order custom Field value with WooCommerce REST API

Adding Multiple Custom Post Types in Wordpress

how to validate form data in codeigniter 4

How can i hide dt if dd got empty value

Laravel Nova, route not found

PHP password_verify

About Contact Privacy policy Terms and conditions