• 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

Split comma separated value from table column into rows using mysql?

PHP Find Array Index value in multi-line array

How to get total pages of PDF with FPDF?

how to see if database exists with PDO [duplicate]

What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

PHP 8.1: strftime() is deprecated

Access relation of pivot table in Laravel

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: no such host known

How to convert time from one timezone to another in PHP

Additional price based on cart item count in WooCommerce

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

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

How update php.ini on a Mac OS X Mojave?

JQuery content editable div and text box on submit not sending POST

About Contact Privacy policy Terms and conditions