• 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

Access relation of pivot table in Laravel

Form Validation and Submission to database

add " ? " in url via htaccess RewriteRule

enable Apache http Authorization header

Pass a select with mysqli_fetch_row to a table

How to map the two arrays with a duplicate value?

How to get Laravel's CSRF Token from Another Website?

Accessors (Getter) & Mutators (Setter) On a Pivot Table in Laravel

How to loop sql table data inside a html table

Add New Parameter to Existing URL using htaccess

VichUploaderBundle error "Expected argument of type "File", "NULL" given" when submitting the form without selecting any file

How to make a array inside array?

Insert multidimensional array to codeigniter cart

How to Install Composer Require doctrine/dbal

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

About Contact Privacy policy Terms and conditions