• 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?

How to test a php login connected to a mysql db through xampp?

woocommerce_wp_select options array from product attribute terms

Alert message after submitting form in PHP

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

how to see if database exists with PDO [duplicate]

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

Whats the point of running Laravel with the command 'php artisan serve'?

Laravel Unknown Column 'updated_at'

Yoast SEO (WordPress Plugin) - Get plugin generated data manually

GRPC installed successfully on ubuntu but php is looking for it in another folder

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

PHP: Convert any string to UTF-8 without knowing the original character set, or at least try

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

Laravel Nova Dependency Container what are the allowed resource properties other than id in dependsOn

About Contact Privacy policy Terms and conditions