• 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: How to raise number to (tiny) fractional exponent?

PHP Deprecated issue when running artisan command

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

Not able to override collapsible.js in magento 2

Uncaught TypeError: Cannot read property 'length' of null when retrieving tags from wp

Manage independently the decimal number of the price of each product [duplicate]

Get latest Tweets - What API

Phalcon: setStatusCode returns empty response

Can't exclude directories from .htaccess mobile redirect?

Facebook PHP SDK - will not logout properly

I want to display a sweetalert after the inserting of data in my database

Creating live search with AJAX and CodeIgniter

Explode not working properly with dash

Star rating with half star support

Use Python plotly chart in PHP

About Contact Privacy policy Terms and conditions