• 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

Performance of foreach, array_map with lambda and array_map with static function

Extract house numbers from address string

Laravel 5.1 Unknown database type enum requested

Must be of the type array, null given,

Laravel: Create morphs() relationship nullable

HTML + PHP + PHPMAILER

Ajax GET request fails in laravel 8

How to get multiple values with same key from an array PHP

How to set a domain name with php artisan serve

PhP how to calculate moments with variables rows

laravel 5.6 bulk inserting json data

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

correct PHP headers for pdf file download

Execute only one time and then wait set period of time before executing again

Laravel Mix Uncaught ReferenceError: $ is not defined

About Contact Privacy policy Terms and conditions