• 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

javascript html popup window

Don't show recurring price for WooCommerce subscriptions worth 0$

How to increase the PHP upload limits [duplicate]

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

Yii Ajax Submit button

Not able to override collapsible.js in magento 2

Hide specific products from unlogged users based in product category in WooCommerce

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

How to test a php login connected to a mysql db through xampp?

array_map triple dimensional array [duplicate]

Return multiple values from a function using mysqli_fetch_assoc [closed]

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

PHP rotate matrix counter-clockwise

Redis Command To Sort Keys

Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables 11 [closed]

About Contact Privacy policy Terms and conditions