• 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

PHP contact form configuration [duplicate]

Check for PDO Results, If None Display Message, If Yes then Loop Through

Popup Window and PHP form

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

Woocommerce redirect after add-to-cart error

Combine array with same value and add other [duplicate]

MySQL upgrade causing unexpected results on simple WHERE clauses

How can I remove the "Advanced" panel of all blocks in WordPress block editor?

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

Parameter is not sent to Laravel route in Ajax

I want a way to give path to my files which are outside of public folder in laravel

How to submit a form when page loads using JavaScript?

How can i hide dt if dd got empty value

Add record for each array elements if missing in table

About Contact Privacy policy Terms and conditions