• 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

generating a random code in php?

Best way to scrolldown onpageload

The difference when using if statement true === something() vs something() === true [duplicate]

nginx err_connection_refused, can anyone help me?

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

Laravel Livewire: jQuery not working in child component loaded via @if statement

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

Utf8 encoding issue with Laravel

PHP -> Next nearest date defined by array of days in week

Woocommerce Checkout - Add conditional field required if one field is filled

How to override header set in Apache config with more specific header in a virtual host

PHP: Telegram Bot: Insert line break to text message

Store / Website Column in Magento 2 Admin Grid - Custom Module

Remove country code from phone number?

php echo remove slashes from url [duplicate]

About Contact Privacy policy Terms and conditions