• 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

Transpose csv file data [duplicate]

PHP: remove filename from path

How can I convert from a{a{} b{}} to a[a[],b[]] using php preg_match?

PHP: set a (deep) array key from an array [closed]

WordPress Subquery returns more than 1 row on SELECT

How can I access an array/object?

Log a user out of a website when they put their computer to sleep

Symfony 4: "Autowire: you should configure its value explicitly."

Add rows to Single product Additional information table in WooCommerce 3.6

enable Apache http Authorization header

how to identify the web server name of remote host

Failing validation doesn't stop code execution in livewire component

How to get company posts from LinkedIn via API?

Woocommerce redirect after add-to-cart error

PHP: Telegram Bot: Insert line break to text message

About Contact Privacy policy Terms and conditions