• 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

Add 2 Webcam in one page with WebcamJS

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

get data-value with variable value

Stop caching for PHP 5.5.3 in MAMP

Add bold text and line break into Laravel Notification Email

IlluminateDatabaseQueryException could not find driver [duplicate]

Not able to access model in the controller mautic

Google API Heatmap Layer exception, why?

onKeyUp event calculation not working on the following rows from php generated forms except the first one

CSV to PHP class properties

Unable to uninstall brew php from homebrew

PHP sort array of objects by two properties

Combine multiple columns into an array as one of the key in a results set

CSS file not imported in laravel blade view

Error converting docx to pdf using Unoconv

About Contact Privacy policy Terms and conditions