• 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 data-value with variable value

Is it possible to change the table name in the migration file-laravel

How to change 'users' auth table and use another instead Laravel

Laravel Mix Uncaught ReferenceError: $ is not defined

How to change product Image when variables are selected in Shop and Archive Pages?

Form Validation and Submission to database

Can't call javascript alert alertify library from PHP

Why getting "Build step 'Execute shell' marked build as failure" error while creating a backup tar for files

ConstraintViolationListInterface to Exception in Symfony

Input and output values for php into the browser?

VB.NET WebRequest with PHP POST

generating a random code in php?

Form repeater send wrong data with last element in Laravel

Clear javascript source cache laravel 5.8

Pass an image through AJAX [duplicate]

About Contact Privacy policy Terms and conditions