• 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

loop through an anchor id

Zig-zag scan an N x N array

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

Symfony/Form add attribute based on the data

html-php form submission after validation through JavaScript [closed]

Loading data from MySQL and populating dropdown select with jQuery Mobile, PHP

How to separate letters and digits from a string in php

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

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

javascript html popup window

Laravel Displaying image from database

How to convert the int value to inch in PHP [closed]

How to programmatically find public properties of a class from inside one of it's methods

Log a user out of a website when they put their computer to sleep

How do I refresh a DIV content?

About Contact Privacy policy Terms and conditions