• 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

Autoloading classes in PHPUnit using Composer and autoload.php

Split comma separated value from table column into rows using mysql?

How to identify whether webp image is static or animated?

GA4 custom event from server side, can someone tell me how i can do the following code in php?

Add Class in html Dynamically in PHP

301 Redirect to remove query string on homepage only

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

phpseclib 2.0 can not use Composer to create autoload

Form repeater send wrong data with last element in Laravel

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

Creating command to backup MySql database in Laravel

Custom post type single page not working

Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, null given in

How to skip cart page on woocomerce for certain products only?

How to get company posts from LinkedIn via API?

About Contact Privacy policy Terms and conditions