• 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

Get image type from base64 encoded src string

Download & Save Zoom Recording in directory by PHP

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

I want a way to give path to my files which are outside of public folder in laravel

Laravel excel maatwebsite 3.1 import, date column in excel cell returns as unknown format number. How to solve this?

Select option menu read from database and use it's values

Dynamic dropdown Ajax PHP request

Jquery DataTables: Data not displaying in table via Ajax

Unable to guess the mime type as no guessers are available Laravel 5.2

How to debug in WooCommerce 3+

Pass a select with mysqli_fetch_row to a table

Natural ORDER in Laravel Eloquent ORM

Stop caching for PHP 5.5.3 in MAMP

Add and update products to session cart in Laravel

How can I get user id from session in javascript?

About Contact Privacy policy Terms and conditions