• 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

Get latest Tweets - What API

Passing a boolean value from checkbox in Laravel form

Show Custom Data in Woocommerce Order Details Admin Area

How to downgrade or install a specific version of Composer?

How to send image,audio or video through the WhatsApp API - PHP

With doctrine ODM, can I embed many subdocuments in a main document?

Why does codeigniter & Linux server throws unserialize() session data error when user tries to login

protect images from being copied

Losing session data after POST from third party website

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

Smarty if isset

Get data from accuweather api url

Parameter is not sent to Laravel route in Ajax

How to add automatically collapse/expand in content wordpress (single.php)?

PHP 8 - libxml_disable_entity_loader() has been deprecated. How do I replace the functionality it provides?

About Contact Privacy policy Terms and conditions