• 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

Too few arguments to function PendingResourceRegistration::name(),1 passed in C:xampphtdocsproject outesweb.php on line 18 and exactly 2 expected

Check if user online laravel

Merge column values from two arrays to form an indexed array of associative arrays

Only on Firefox "Loading failed for the <script> with source"

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

500 Internal Server Error on Ajax request. Not sure the origin of the problem

How to give apache permission to write to home directory?

Show Custom Data in Woocommerce Order Details Admin Area

Generate random username based on full name php

How do I Post to .txt document before form submits

How to change the app environment at run time?

Laravel: Create morphs() relationship nullable

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

Symfony there are no commands defined in the "make" namespace

How can I convert from a{a{} b{}} to a[a[],b[]] using php preg_match?

About Contact Privacy policy Terms and conditions