• 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

How to average columns of data from multiple, flat arrays?

how to fix Service provider class not found when using repository?

Session timeout in Yii2

Navigation idle on content download

GA4 custom event from server side, can someone tell me how i can do the following code in php?

Laravel 5.5 change unauthenticated login redirect url

Error when uploading certain .png files "Interlace handling should be turned on when using png_read_image"

What is PHP's equivalent of JavaScript's "array.every()"?

How to edit Records using CodeIgniter

get folder directory from input type file - PHP

Require a class from another class - php

Trying to iterate over a mongodb cursor twice - failing

How to reset Laravel AuthManager/guards in between API calls in tests?

How to create laravel storage symbolic link for production or sub domain system?

How to validate Envato Purchase Code in PHP

About Contact Privacy policy Terms and conditions