• 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

Utf8 encoding issue with Laravel

Best way to scrolldown onpageload

selected value from the listbox in php

add uri parameter to Route name in laravel

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

Target Individual Form Instance/Counter Inside A PHP While Loop

javascript html popup window

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Transpose multidimensional array and join values with commas

How to install ZeroMQ for PHP on an Alpine Linux container?

Read users and passwords from a txt file

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

Toggle between a textbox and a select using PHP

how to get value from array in laravel

How to properly start Laravel 8 with Bootstrap & authentication

About Contact Privacy policy Terms and conditions