• 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 change HTML structure inside WP <head>

Last order would be re-order in wooCommerce. How is it possible?

array_map triple dimensional array [duplicate]

Saving Data from form to database using AngularJS and php

CSS file not imported in laravel blade view

Send same name multiple checkbox values via ajax

Unable to guess the mime type as no guessers are available Laravel 5.2

Install mysql client in docker image

get folder directory from input type file - PHP

Laravel Mix Uncaught ReferenceError: $ is not defined

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

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

Comma separated list from array with "and" before last element

How can I make this nested location configuration use the correct path to call a php program?

Wordpress 'post_type_link' hides permalink

About Contact Privacy policy Terms and conditions