• 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

Composer Script echo

Install mysql client in docker image

Prevent blank space in pdf pages (DomPdf)

Prestashop webservice API creating cart rules

Can't call javascript alert alertify library from PHP

PHPMyAdmin not working as intended at remote server. Error 500, $respond not found

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

Generate random username based on full name php

PHP web3 ERC20 token function call

How to get the survey List from surveygizmo API in the Postman?(Trial Version)

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

Return new collection without modifying original collection

How do I get friend list from Friends table with counts of friends of my friends

Laravel 8: Array to string conversion while calling route:list

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

About Contact Privacy policy Terms and conditions